Michdd Posted June 8, 2009 Share Posted June 8, 2009 I have a main div, which has the main background and stuff. Then within this main Div I have two sections, a main area and a side bar. Main has a float to the left, and sidebar has a float to the right. However when I place excessive content in either of these sections the page doesn't grow. Unless I place it directly in the main section. Basic concept: <div id="main"> <div id="main_left">//Has left float //Anything placed here doesn't make 'main' grow' </div> <div id="main_right">//Has right float //Anything placed here doesn't make 'main' grow' </div> </div> Is there any way to fix this? Link to comment https://forums.phpfreaks.com/topic/161420-page-not-extending-with-floats/ Share on other sites More sharing options...
Axeia Posted June 8, 2009 Share Posted June 8, 2009 place a <div style='clear: both'></div> after the end of the main_right div. Link to comment https://forums.phpfreaks.com/topic/161420-page-not-extending-with-floats/#findComment-851871 Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Also type clear fix into google. You'll find many options, I made a few tweaks and have made my own, but it is usually a very handy class to have in your default stylesheet Link to comment https://forums.phpfreaks.com/topic/161420-page-not-extending-with-floats/#findComment-851934 Share on other sites More sharing options...
haku Posted June 9, 2009 Share Posted June 9, 2009 #main { overflow:auto; } Link to comment https://forums.phpfreaks.com/topic/161420-page-not-extending-with-floats/#findComment-852016 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.