考慮下面的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