html - Sizing block-level elements automatically with its content -
i have following code (simplified source):
<div class="container"> <div class="body"> <div class="mainstuff">...</div> <div class="secondarystuff">...</div> </div> <div class="footer">...</div> </div>
the problem when browser renders page, interprets .body
having 0
height, , such, footer placed right on top of .mainstuff
, .secondarystuff
. .mainstuff
, .secondarystuff
overflowing .body.
how set property body adjusts size depending on content? works if content not inside element, doesnt seem adjust height according children divs...
thanks
please provide more code.
most interior divs either floated or absolute. if floated, adding overflow:hidden
parent div should adjust size fit interior divs.
from described though seems mainstuff
, secondarystuff
position:absolute
, don't have be. if are, should add position:relative
body class div
Comments
Post a Comment