scotchegg78 Posted June 6, 2008 Share Posted June 6, 2008 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; } Quote Link to comment https://forums.phpfreaks.com/topic/108965-3-columns-all-need-to-expand-to-the-tallest/ Share on other sites More sharing options...
calabiyau Posted June 6, 2008 Share Posted June 6, 2008 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> Quote Link to comment https://forums.phpfreaks.com/topic/108965-3-columns-all-need-to-expand-to-the-tallest/#findComment-559034 Share on other sites More sharing options...
dbrimlow Posted June 8, 2008 Share Posted June 8, 2008 Here is the link to the faux columns technique ... it is the only way. http://www.alistapart.com/articles/fauxcolumns/ You CAN do it with liquid percentage witdhs as well (just need to do a little math to figure out the px placement of the graphic's sections). Quote Link to comment https://forums.phpfreaks.com/topic/108965-3-columns-all-need-to-expand-to-the-tallest/#findComment-560182 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.