March 1, 201115 yr Dear all... i dont want a fixed height for the div it should vary according to d contents.... i have multiple div inside the outer div.... still the height of outer div doesnt expand how to fix this problem.... i have tried giving height to be auto also 100% both dint work anything else....
March 1, 201115 yr If your inner divs are all floated, the background of the outer div will not extend its background down to the bottom of the nested floated divs. You need to add overflow: hidden; to the style of the outer div as item 2d here:- http://www.wickham43.net/firefoxbackground.php Item 2b is an alternative.
March 1, 201115 yr put this in you html, just before the container div closes <div class="clear"></div> the css: .clear{ clear: both; }
March 2, 201115 yr I'm not 100% sure what you mean but I can give a tip. min-height: 5em or whatever number you want will expand the div out to what you want and then expand when content has been put there. I have found % and pixels to not grow.
March 2, 201115 yr min-height is OK, except that it doesn't work in IE6. The other methods in the posts above would probably be used in preference to min-height, although more and more developers are now ignoring IE6. If your target viewers are likely to be world-wide, like Africa where old computers are recycled, you should code for IE6 but perhaps not for developed country viewers.
March 4, 201115 yr Author thanks guys for everyone,,, Ash solution worked for me..... i dint check it for ie6 mate as tats not d requirement for me... im learning a lot from this site thanks again
Create an account or sign in to comment