给定以下 HTML:
<!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
的浏览器窗口?
最佳答案
为你的容器设置一个min-width
:
#container {
min-width: 1000px;
}
关于html - 左右浮动两个div : How can I keep them on the same level when a page resizes?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4082894/