SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE7 Height Issue

    Hi Everyone,

    Can someone tell me how to make this work in IE6.

    Code HTML4Strict:
    <html>
    <body>
    	<div style="background-color: #000; height:5px;"></div>
    </body>
    </html>


    That's the simplest I broke the code down to. It seems that no matter what I try and do with hacks, different attributes, etc. IE6 will not interpret a proper height value.

    Any help would be appreciated,

    Thanks,

    Nick
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com

  2. #2
    SitePoint Zealot
    Join Date
    Sep 2007
    Location
    Wiltshire, UK.
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried adding <body style="margin: 0; padding 0;">

  3. #3
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea. That doesn't work.
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com

  4. #4
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured out how to work around it. Though I would rather use straight css so if anyone has any other ideas please let me know.

    But this works
    Code HTML4Strict:
    <html>
    <body>
        <div style="background-color: #000; height:5px; line-height: 0">&nbsp;</div>
    </body>
    </html>
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,475
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    IE6 treats height as a minimum and if there is anything in the element that will stretch the height then IE will accommodate it. The height happens to be the current font-size/line-height and as you found out setting either of those to zero will cure the problem. I usually use overflow:hidden instead which kills any overflow.


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
  •