CSS auto-grow page height based on text
I have a pure CSS layou开发者_JS百科t with a simple container that houses my text. The container has a min-height attribute.
The page content is generated from the database. The problem is as the page grows the text overflows the container that it is in.
How do I get around this?
My guess is you need to clear your floats I'd say..
Clearing Floats
<div id="myContainer">
<textarea />
<div class="clear"> </div>
</div>
If you want to trigger hasLayout to the container without additional markup you can use
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {
zoom: 1; /* triggers hasLayout in IE */
}
精彩评论