fixed background-attachment in Netscape 7

Discussion in 'HTML' started by Fredo Vincentis, May 23, 2004.

  1. I am trying to attach a background image to a <div> that has an
    auto-overflow:

    background-attachment: fixed;
    overflow: auto;

    This works fine in IE 5 and 6, but I have got difficulties with it in NN7.
    It seems that, when the attachment is fixed, the image does not start at the
    top left corner, but moves out of position (I only see the bottom half of
    the image in my DIV).

    Did anybody have this problem before and did you find a work around?

    Thanks heaps!
     
    Fredo Vincentis, May 23, 2004
    #1
    1. Advertising

  2. Fredo Vincentis

    brucie Guest

    in post: <news:c8ptvq$2li8$>
    Fredo Vincentis <> said:

    > I am trying to attach a background image to a <div> that has an
    > auto-overflow:
    > background-attachment: fixed;
    > overflow: auto;
    > This works fine in IE 5 and 6, but I have got difficulties with it in NN7.


    thats nice but its a bit useless telling us about it without a URL
    demonstrating the issue especially when you don't specify which NS7.
    NS7.1 is based on the 1.4 gecko which i don't have but there doesn't
    seem to be an issue with the 1.6 gecko.

    --
    b r u c i e
     
    brucie, May 23, 2004
    #2
    1. Advertising

  3. Fredo Vincentis wrote:

    > I am trying to attach a background image to a <div> that has an
    > auto-overflow:
    >
    > background-attachment: fixed;
    > overflow: auto;
    >
    > This works fine in IE 5 and 6, but I have got difficulties with it in NN7.


    Unlikely - it is more likely that it is doing what you want instead of what
    you are telling it to do in IE.

    > It seems that, when the attachment is fixed, the image does not start at
    > the top left corner, but moves out of position (I only see the bottom half
    > of the image in my DIV).


    background-attachment: fixed anchors the image to the _canvas_ instead of
    the element.

    http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html for a demo
    (don't bother looking in IE).

    I don't know how standards compliant browsers handle background images on
    overflowing elements, but you could look at:

    (1) Giving background-attachment fixed only to IE
    (2) Putting the background image on a _parent_ to the element with the
    overflow property set.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, May 23, 2004
    #3
  4. Fredo Vincentis

    Steve Pugh Guest

    "Fredo Vincentis" <> wrote:

    >I am trying to attach a background image to a <div> that has an
    >auto-overflow:
    >
    >background-attachment: fixed;
    >overflow: auto;
    >
    >This works fine in IE 5 and 6, but I have got difficulties with it in NN7.
    >It seems that, when the attachment is fixed, the image does not start at the
    >top left corner, but moves out of position (I only see the bottom half of
    >the image in my DIV).


    Have a look at
    http://www.w3.org/TR/CSS21/colors.html#propdef-background-attachment
    especially the part that says that the background is fixed with
    respect to the viewport.

    This means that if you have

    <body>
    <h1>heading</h1>
    <div style="background: url(foo.png) fixed;">blah blah blah</div>
    </body>

    the image is fixed to the viewport and hence it's origin is located at
    the origin of the viewport, not at the origin of the div. Hence only
    the part of the image that extends down into the div will be visible.
    IE gets this wrong, Gecko gets this right.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, May 23, 2004
    #4
  5. Fredo Vincentis

    Whitecrest Guest

    Whitecrest, May 23, 2004
    #5
  6. Whitecrest wrote:

    > But why demonstrate something that doesn't work in 80+% of the worlds
    > browsers? (EVEN if it is 100% standards correct)


    css/edge is intended, first and foremost, to be as relentlessly creative
    with CSS as we have been practical all these years. It does not exist to
    present or explain safe cross-browser techniques; in fact, almost the
    opposite. The goal here is to find ways to make CSS live up to its
    fullest potential, with only minimal regard to browser limitations. For
    all the time we've spent using CSS, most of us have barely scratched the
    surface of the power CSS embodies, because we've been too caught up in
    recreating old-style table-based design ideas and worried about support
    limitations. No more. Now we start digging for treasure.

    -- http://www.meyerweb.com/eric/css/edge/

    Besides - in combination with hiding techniques it is possible to give a
    very nice layout for web browsers and something simpler for IE.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, May 23, 2004
    #6
  7. Fredo Vincentis

    brucie Guest

    in post: <news:>
    Whitecrest <> said:

    > But why demonstrate something that doesn't work in 80+% of the worlds
    > browsers?


    so you can ask that question every time someone does something thats not
    supported by a crappy three and a half year old browser.

    --
    b r u c i e
     
    brucie, May 23, 2004
    #7
  8. Fredo Vincentis

    Whitecrest Guest

    In article <>,
    says...
    > in post: <news:>
    > Whitecrest <> said:
    > > But why demonstrate something that doesn't work in 80+% of the worlds
    > > browsers?

    > so you can ask that question every time someone does something thats not
    > supported by a crappy three and a half year old browser.


    I totally agree it is a crappy browser. But that is irrelevant. What
    is relevant is that 80+% use it.

    --
    Whitecrest Entertainment
    www.whitecrestent.com
     
    Whitecrest, May 23, 2004
    #8
  9. "Steve Pugh" <> wrote in message
    news:...
    > "Fredo Vincentis" <> wrote:
    >
    > >I am trying to attach a background image to a <div> that has an
    > >auto-overflow:
    > >
    > >background-attachment: fixed;
    > >overflow: auto;
    > >
    > >This works fine in IE 5 and 6, but I have got difficulties with it in

    NN7.
    > >It seems that, when the attachment is fixed, the image does not start at

    the
    > >top left corner, but moves out of position (I only see the bottom half of
    > >the image in my DIV).


    > the image is fixed to the viewport and hence it's origin is located at
    > the origin of the viewport, not at the origin of the div. Hence only
    > the part of the image that extends down into the div will be visible.
    > IE gets this wrong, Gecko gets this right.


    Hi Steve,

    thanks, that clears things up. I will have to find a workaround then.
     
    Fredo Vincentis, May 24, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    497
  2. Dimorph
    Replies:
    2
    Views:
    505
    Steve Pugh
    Feb 24, 2004
  3. GuyBrush Treepwood
    Replies:
    4
    Views:
    13,873
    Toby Inkster
    Mar 29, 2005
  4. johnp
    Replies:
    4
    Views:
    3,677
    Toby Inkster
    May 23, 2005
  5. Patrice
    Replies:
    2
    Views:
    186
    Patrice
    Oct 6, 2003
Loading...

Share This Page