SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: which IE6 bug?

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    NJ
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    which IE6 bug?

    I am trying to float some text around a photo image using
    Code:
    <div>
    <p>
    <img class="floatleft" src="image.gif" alt="" width="100" height="100">Lorem ipsum dolor sit amet, consectetuer...
    </p>
    </div>
    I have set <div> to clear:both so that if there isn't enough text, it doesn't matter and the <div> stack on top of each other.

    In Firefox3 and Opera, there is not gap between the <div>, but in IE6 there is.

    Can someone point me to the IE6 bug that is the culprit?

  2. #2
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    It sounds like you just need to trip haslayout for IE6.

    Working from the code you posted this was the best I could make of what you are trying to do.

    Code HTML4Strict:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Test</title>
     
    <style type="text/css">
    div {
        clear:both;
        overflow:hidden;/*contain inner floats and IE7 haslayout*/
        background:#EEF;
    }
    .two {background:#CDF;}
     
    * html div {zoom:1;}/*IE6 haslayout*/
     
    img.floatleft {
        float:left;
        background:red;
    }
    .two img {background:lime;}
    p {margin:0;}
    </style>
     
    </head>
    <body>
     
    <div>
        <p><img class="floatleft" src="image.gif" alt="" width="100" height="100">Lorem ipsum dolor sit amet, consectetuer...</p>
    </div>
    <div class="two">
        <p><img class="floatleft" src="image.gif" alt="" width="100" height="100">Lorem ipsum dolor sit amet, consectetuer...</p>
    </div>
     
    </body>
    </html>

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    NJ
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was it!
    Thank you.

    Boy, do I hate IE.
    Last edited by ieee488; Mar 17, 2010 at 20:50. Reason: found answer to my question


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
  •