我想创建一个带有包含标题和一些工具按钮的标题栏的简单框。我有以下的标记:IE7中奇怪的浮动行为
<div style="float:left">
<div style="background-color:blue; padding: 1px; height: 20px;">
<div style="float: left; background-color:green;">title</div>
<div style="float: right; background-color:yellow;">toolbar</div>
</div>
<div style="clear: both; width: 200px; background-color: red;">content</div>
</div>
这使得在Firefox罚款和Chrome:
http://www.boplicity.nl/images/firefox.jpg
然而IE7完全打乱了,并把正确的浮动元素到页面的右侧:
http://www.boplicity.nl/images/ie7.jpg
这可以修复吗?
您可能需要为这个问题提供更多的上下文。你是说内容区域将包含不同大小的表格? – 2008-10-10 08:32:03
有用的http://css-class.com/articles/explorer/floats/floatandcleartest1.htm – elclanrs 2012-02-10 20:10:31