我試圖建立具有類似博客的應用的佈局:固定寬度頭 固定位置列布局的最小寬度
- 一個固定位置寬度左右立柱
- 可滾動中心固定寬度的內容
因此,基本上有一個在頁面上,通過一個固定的結構包圍的中間的可滾動列(即不會滾動距離)。
我的問題:是否有一種方法可以防止右欄覆蓋中間的一個,如果用戶調整窗口太小?我想一個滾動條,而不是..
這就是我想出了:
<html>
<body>
<style type="text/css">
.header {
background: red;
position: fixed;
top: 0px;
width: 100%;
height: 100px;
}
.left {
background: yellow;
position: fixed;
top: 100px;
width: 180px;
}
.right {
background: green;
position: fixed;
top: 100px;
right: 0px;
width: 180px;
}
.content {
background: grey;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
width: 640px;
}
.wrapper {
padding: 0 180px;
}
</style>
<div class="header">HEADER</div>
<div class="left">LEFT</div>
<div class="wrapper">
<div class="content">
SCROLLABLE<br/>
CONTENT<br/>
</div>
</div>
<div class="right">RIGHT</div>
</body>
</html>
(?順便說一句,有沒有共享這樣的測試網站)
正如你所看到的,當窗口太小時,左側和中間的列可以正確處理,但正確的一個最終可能會覆蓋它們......有沒有辦法阻止它?
編輯:我注意到左邊的列有它的問題太多:/當水平滾動條出現,您滾動到右側,下左側一箇中間一列滾動......我開始覺得我要去完全錯誤的方式..:/
有一個網站http://jsfiddle.net/你的問題:http://jsfiddle.net/Gr58j/ – Praneeth 2011-03-26 17:45:13
謝謝:)在這裏它是http://jsfiddle.net/TqTaE/ – Joril 2011-03-26 17:50:12