【发布时间】:2013-01-16 19:37:17
【问题描述】:
我想让一个固定大小的 div 向右浮动,其余的空间需要留下。 我已经这样做了:
HTML:
<div class="container">
<div id="rightCntr">
</div>
<div id="leftCntr">
</div>
</div>
CSS:
#leftCntr {
float: none; /* not needed, just for clarification */
background: #e8f6fe;
/* the next props are meant to keep this block independent from the other floated one */
width: auto;
overflow: hidden;
}
#rightCntr { float: right; width: 213px;}
这在 Firefox 和 Chrome 中运行良好,但在 IE8 中却完全出错。 Example
【问题讨论】:
-
你知道左边的容器需要多宽(以像素为单位),还是可变的?
-
在
float:rignt之后尝试clear:both。 -
你能分享你的
<head>部分吗,文档模式是IE5 quirks
标签: html css internet-explorer css-float