SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast BeauCreative's Avatar
    Join Date
    Oct 2004
    Location
    Michigan
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    two divs side by side that will resize their container

    I cannot figure this out. I need to have two divs side by side (two columns) inside of a container div. They are both variable length, and there isnt one that is always longer. So, I need thier container to be resized to the longest one. Any ideas how to do this? I can use absolute or relative positioning because then they wont resize thier container, and neither will floated divs.
    BeauCreative Web Development
    FotoFight Photography Contests
    Engolfed - Link Exchange? Write for us? PM Me.
    datingUpdate | BiographyCollection - Link Exchange? PM Me.

  2. #2
    The MacGyver of Design bronze trophy Johan Dahlström's Avatar
    Join Date
    Oct 2004
    Location
    Uppsala, Sweden
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    .breaker { clear: both;
             }
    
    div#container { width: 800px;
                  }
    
    div#div1 { float: left;
               width etc...
             }   
    
    div#div2 { float: right;
               width etc...
             }
    
    [...]
    
    <div id="container">
    
       <div id="div1">Duh</div>
       <div id="div2">Duh</div>
    <br class="breaker" />
    </div>

  3. #3
    SitePoint Enthusiast BeauCreative's Avatar
    Join Date
    Oct 2004
    Location
    Michigan
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works perfect!

    thanks a ton
    BeauCreative Web Development
    FotoFight Photography Contests
    Engolfed - Link Exchange? Write for us? PM Me.
    datingUpdate | BiographyCollection - Link Exchange? PM Me.


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
  •