考虑下面的HTML:两个div左右浮动:页面大小调整时,如何将它们保持在同一水平上?
<!DOCTYPE html>
<html>
<body>
<div id="container">
<div id="left" style="float: left; background-color: #777; width: 500px;">
Here is some content. Blah blah blah etc.
<div style="height: 50px;">Some more content</div>
And finally some more.
</div>
<div id="right" style="float: right; background-color: #aaa; width: 500px;">
Here is some content. Blah blah blah etc.
<div style="height: 50px;">Some more content</div>
And finally some more.
</div>
<div style="float: clear;"></div>
</div>
</body>
</html>
我能做些什么来div#container
或其他标记,以防止div#right
从div#left
下移动时我调整浏览器窗口使得这些窗口宽度越小则1000px
?
没有这样做。你应该改变你的答案或删除代码。虽然我欣赏这个链接。我会检查出来的。 – DJTripleThreat 2010-11-02 23:41:14