SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)

    Question about IE6, negative margins, and position:fixed

    Hallo monks. This should be an easy question but the answers I've found on Teh Googlies doesn't match what I've been reading.

    In The Zen of CSS Design, Bonsai Sky (www.csszengarden.com/069) uses the idea that IE6 doesn't understand negative margins, nor position:fixed (as far as I know, it does work on the body, yes? Just nowhere else?), so the designer could hide two things at the same time from IE6 by simply mentioning position:fixed on something and then setting a normal position (left: 100%) which IE6 sees, moving the thing all the way off-screen to the right, and then dragging it back with margin-left: -100% for all the other browsers which IE6 does not see.

    Now on Teh Internets I've found people using negative margins with IE6 with glee (and I've used it myself for the nagative-margin-float-wrap-trick) I guess so long as you have triggered Haslayout, which most people do with position: relative (mine apparently do it because I'm floating something).

    So, which is it? Does position: fixed not trigger Haslayout because IE6 doesn't understand it at all?? It seems to go along happily with the left: 100% which I thought only works if you set some position declaration other than static... but if IE6 doesn't understand "fixed" then how does that count? It will scroll the thing in question.

    When can I safely assume IE6 will NOT see something's negative margin? I've been using them all along and never ran across this until the book (and I'd read it a few months earlier but missed that part... now that I'm studying IE6-design vs. everyone-else, it popped out at me).

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since when doesn't IE 6 understand negative margins? I've used them all the way back to IE 5.01 for crying out loud!

  3. #3
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    That's what I thought. But I'm definitely NOT seeing the black borders on that Zen Garden page in IE6! And according to the book it's because "the same browsers which don't understand position:fixed are the same ones who don't understand negative margins." <--that's a paraphrase actually, not a quote-- eating lunch now.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,802
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    Ie understands negative margins ok although there are occasions when it may get it wrong due to haslayout, double margin bugs or position:relative issues but most of the time its fine.

    The zen garden layout you pointed to is using fixed positioning which Ie doesn't understand (except for background images applied to the body element).

    The black borders are missing because the author has sent them off the screen using a negative left margin of 100&#37;. Browsers that understand position:fixed have been given a left position of 100% which brings it back into view. IE6 ignores the left:100% because it doesn't understand position:fixed.

    The issue is that Ie6 and under don't understand fixed positioning unless you use some mighty hacks which affect the whole structure.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •