I have this html code
<section id="sec" style="height:auto">
<div id="wrap">
<div id="con">
<h1>....</h1>
<div id="col1">
<p>... long texts ...</p>
</div>
<div id="col2">
<p>... long texts ...</p>
</div>
</div>
</div>
</section>
<div id="buttom" style="border-top: 1px solid rgb(153, 153, 153)">
<p>...text here ... </p>
</div>
my problem now is that the height:auto of section#sec did not work in many divs inside of it…
is there any way that wihout removing any divs, the height auto will be work?
heightis not a property inherited from parent elements. If you want the divs insidesection#secto inherit this property, you need to make a selector for it in CSS (or set inline styles on each one manually).But since
height:autois already the default, you may be looking for something else entirely.