我试图建立具有类似博客的应用的布局:固定宽度头 固定位置列布局的最小宽度
- 一个固定位置宽度左右立柱
- 可滚动中心固定宽度的内容
因此,基本上有一个在页面上,通过一个固定的结构包围的中间的可滚动列(即不会滚动距离)。
我的问题:是否有一种方法可以防止右栏覆盖中间的一个,如果用户调整窗口太小?我想一个滚动条,而不是..
这就是我想出了:
<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