SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Interesteing IE 7 Bug

    I found an interesting IE7 Bug.

    If you have a container that has the overflow set to auto or scroll and within that container you have list-items having relative-positioned elements, IE7 doesn't know what to do with it. Those elements positioned relatively do not abide to the overflow setting.

    I'm not quite sure how to express this very well, but you can see what I'm talking about here:

    http://www.sitehatchery.com/articles/ie-list-item.php

    I came up with somewhat of a fix - which is simply to control positioning with margins. But somehow that is very limiting.

    Has anybody ever run across this or know anything about it? I couldn't find anything on google, but I'd like to get this working correctly so that I can control the relative positioning of the item.
    My website: www.sitehatchery.com

    Recent Article: Dynamic CSS

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    IE walks up the tree looking for what the paragraphs should be positioned relative to.

    If IE can't find anything it positions it relative to the body.

    The solution: set a relative position on the container itself as well.

  3. #3
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    To be honest, using the Position property in css isn't a good idea. IE7 doesn't handle it properly, and IE6 doesn't even handle it. Firefox isn't that great with them either.

    The solution is to use the Padding and Margin properties instead. It means you have to think about it differently, but it's cross-browser friendly.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  4. #4
    hi galen's Avatar
    Join Date
    Jan 2006
    Location
    New Haven, CT
    Posts
    1,228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know why you think positioning doesnt work well. As long as you stay away from position: fixed in ie6 you should have no problems.
    Last edited by galen; Dec 9, 2007 at 21:27.

  5. #5
    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)
    Galen's right. Position: relative (as do the others, with the exception of position: fixed; in IE 6) does work in IE.

    Oh, and to fix this particular problem, add position: relative; to the #list_test selector (and remove the embedded stylesheet from within the body section of the page as well).
    Last edited by Dan Schulz; Dec 9, 2007 at 21:36.

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Adding position:relative to the #list_test worked. Thanks!

    I did remove the embedded stylesheet from within the body section of the page. I know that this is technically incorrect, but I've never understood why. It's always worked within the body tag, so why is it incorrect?
    My website: www.sitehatchery.com

    Recent Article: Dynamic CSS

  7. #7
    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)
    Because it doesn't belong there (it doesn't output HTML or reference a script that can, nor does it wrap around text - in other words, it doesn't "mark up" anything).

  8. #8
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    My website: www.sitehatchery.com

    Recent Article: Dynamic CSS

  9. #9
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    IE walks up the tree looking for what the paragraphs should be positioned relative to.

    If IE can't find anything it positions it relative to the body.

    The solution: set a relative position on the container itself as well.
    Could IE be correct here? Firefox will position it relative to the parent container. Whereas IE will position it relative to the closest relative-positioned parent container below the body (did I say that right?). So, it seems that you would have more control with IE's way - though it would be easier to make mistakes. Is this analysis correct, and what do you think?
    My website: www.sitehatchery.com

    Recent Article: Dynamic CSS

  10. #10
    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)
    Not likely. Opera and Safari do the same thing as Firefox here.

  11. #11
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I now see where your second question to the same post (posted at the same time) on Webdeveloper came from, which I answered there...

    [rant]Might I suggest not posting multiple forums at the same time? - if you don't get an acceptable response on one forum, then post on another..[/rant]

  12. #12
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm new to this forum community. In addition to getting an answer to my question, I'm wanting to see if I get the same level attention to posts as on Webdeveloper.com. I've been with the other forum for a long time and I thought I'd try a new forum--and I'm really liking it.
    My website: www.sitehatchery.com

    Recent Article: Dynamic CSS

  13. #13
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sitehatchery View Post
    and I'm really liking it.
    Yes, 'tis a nice place ...


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
  •