SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    australia
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE 6 Divs Cut offf

    As some of us may well know IE 6 cuts of longer div content when the float blah is used in css. Does anyone know the hack to prevent this?

    ~Hark

  2. #2
    SitePoint Addict hurricane.uk's Avatar
    Join Date
    May 2003
    Location
    Liverpool
    Posts
    361
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE isn't cutting the div off, it's allowing the float to overflow out of it as it's not in the normal flow.

    Add <br style="clear:both;" /> after your float and before the closing </div> tag for the container. This will make the container stretch to accomodate the floated section.

  3. #3
    SitePoint Member
    Join Date
    Oct 2003
    Location
    australia
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh that's much impler than the javascript hack i was looking for. Thanks , and since I use classes can I just put clear:both; after the float command, and the closing of each div?

  4. #4
    SitePoint Addict hurricane.uk's Avatar
    Join Date
    May 2003
    Location
    Liverpool
    Posts
    361
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It just goes inside the div that contains the float(s)

    eg.
    <div id="container">
    <div id="floatleft">...</div>
    <div id="floatright">...</div>
    <br style="clear:both;" />
    </div>


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
  •