PDA

View Full Version : DIV Height wont increase


sumeru
11-26-2010, 03:25 AM
Hi there,

I have been having trouble with some DIV tags in my site, the problem is that their height wont expand if i add a couple of more div's inside it using the float property. As soon as i remove the float the box expands.

I have uploaded the file here - http://bhainsrorgarh.com/ti/discover_india_packages.html
As you can see the box where there is an image and text on the right side doesn't expand.

The CSS for the DIV's that i am using in this page are -
#main_content_discover_india_packages {
display: block;
margin-left: 10px;
padding-right: 10px;
padding-bottom: 10px;
margin-top: 10px;
height: auto;
}
#discover_india_packages_logo {
height: 90px;
width: 290px;
float: left;
}
#discover_india_packages_intro_text {
height: 90px;
width: 388px;
text-align: center;
color: #993333;
padding-left: 300px;
float: right;
}

Any help will be greatly appreciated.
Sumeru

Corrosive
11-26-2010, 06:07 AM
Floating elements taks the out of the natural 'page flow' so the wrapping div won't expand. Try this; http://corrosiveonline.co.uk/tutorials_css_floats_for_layout.php (demo three and four)

sumeru
11-27-2010, 02:49 PM
Thanks, figured it out.