开发者

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">&nbsp;</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 */
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜