SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast aherrera's Avatar
    Join Date
    Mar 2005
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Overflow: auto + float: left cause problems?

    Has anyone ever had any trouble with divs inside a container div that has overflow set to auto? I'm working on a client project and whenever I use a float, the container div expands instead of staying at the height I specify and showing a scrollbar. I'm stumped.

    Here's some basic sample code...

    HTML:
    Code:
    <div class="container">
       <div class="left">...</div>
       <div class="right">...</div>
    </div>
    ...
    CSS:
    Code:
    .container {
       width: 100%;
       height: 150px;
       overflow: auto;
       ...
    }
    
    .left {
       width: 35%;
       float: left;
    }
    
    .right {
       width: 60%;
       float: right;
    }

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Michigan
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Setting the overflow to auto will allow the box to expand when the content contained within the bounding box of the block-level element extends beyond the dimensions of the box.


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
  •