The Little Guy Posted March 23, 2010 Share Posted March 23, 2010 I have a div that is a container, and it is centered on the page, then I have have div's inside of it which are floated. When I display it it displays weird... I want that div to be below the white box. The white box is inside the container, and the container is only as high as the y position of the red box. how can I make the container be as tall as its content? Container: #container{ margin:auto; margin-top:40px; min-height:200px; width:800px; position:relative; } Content: .content{ float:left; padding:10px; width:100%; clear:both; background-color:#FFF; -moz-border-radius:20px; -webkit-border-radius:20px; border-radius:20px; -moz-box-shadow: 0 0 10px #000; -webkit-box-shadow: 0 0 10px #000; box-shadow: 0 0 10px #000; } [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/196202-container-not-as-tall-as-its-content/ Share on other sites More sharing options...
haku Posted March 23, 2010 Share Posted March 23, 2010 Add: overflow:auto; to the container. Link to comment https://forums.phpfreaks.com/topic/196202-container-not-as-tall-as-its-content/#findComment-1030376 Share on other sites More sharing options...
The Little Guy Posted March 23, 2010 Author Share Posted March 23, 2010 that worked, the only problem was that it cut off some of the content, and displayed a horizontal scrollbar Link to comment https://forums.phpfreaks.com/topic/196202-container-not-as-tall-as-its-content/#findComment-1030380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.