Jump to content

3 columns, all need to expand to the tallest.


scotchegg78

Recommended Posts

Hi guys

 

I have 3 columns inside a main container div.

They all have a border, so if they are not all the same height then i have 3 varying looking heights.

 

What i would like is for the 3 columns to all drop in height to the longest one?

 

eg

 

    <div id="content_container">
<div id="column_left">some small content in 1 column</div>
<div id="column_center"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam tempus, mi et sagittis tincidunt, massa urna fermentum est, id imperdiet erat turpis at neque. Nullam sit amet magna. Maecenas arcu leo, tempor at, condimentum et, placerat in, urna. Fusce sed nisl id est lobortis porta. Aenean commodo lectus eu augue </div>
<div id="column_right">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam tempus, mi et sagittis tincidunt </div>
</div>

 

ignoring width colour etc what do i need to ensure the 3 columns all stay the same height as the tallest?

 

thanks

 

EDIT

 

if it helps this is the code so far...

#content_container {
float:left;
display:inline; /* god damn IE! */

}
#column_center { /*263 total width */

width:230px;
float:left;
margin-right:5px;
border:1px solid #CCCCCC;
text-align:left;
padding:15px;

}
* html #column_center {height:443px;}
#column_left { /*263 total width */

width:228px;
float:left;
margin-right:5px;
border:1px solid #CCCCCC;
text-align:left;
padding:15px;


}
* html #column_left {height:443px;}
#column_right { /*258 total width */


width:228px;
float:left;
margin-right:0px;
border:1px solid #CCCCCC;
text-align:left;
padding:15px;


}

 

 

Link to comment
Share on other sites

since all your columns are fixed width you can use the faux columns technique by creating an image that is the full width of your container div but only a few pixels tall and block out the colors to match the width of each column

 

Say they are red, white, blue

 

Your image would look like

 

RRRRRRRRRRRRRRRRRRRRRRRWWWWWWWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBBBBB

 

 

Set that as the background image of your container div and set it to background-repeat: repeat-y

 

Then make sure to clear your floated columns within the container div

with something like

 

<div style="clear: both;"></div>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.