我想要这个布局:
+-----------+------------------------+--------------+
| |
| TOP |
| |
| |
+-----------+------------------------+--------------+
| | | |
| | | |
| | | |
| B | CONTENT | B |
| | | |
| | | |
+-----------+ |--------------+
| | | |
| | | |
| | | |
| C | | D |
| | | |
| | | |
| | | |
+-----------+------------------------+--------------+
“TOP”和“B”有一个背景:图像(从顶部的蓝色渐变到白色 - 例如 - 在底部),“CONTENT”是主页(菜单,条目等),“C”是白色颜色。
如果“D”也是白色,那么就没有问题了。但是“D”是其他颜色,例如红色。
当“内容”固定为 900 像素并居中(边距:自动)时,我必须进行设置,并且必须考虑不同的显示器宽度。“C”颜色必须在内容的左侧,“D”在右侧。页面必须兼容IE7、8、9等浏览器。
怎么做?
更新:
好的,让一些示例代码:
<body>
<div id="content">
I don't know, maybe height is less maybe not...
<div class="clear"></div>
</div>
</body>
或者:
<body>
<div class="wrapper">
<div id="content">
I don't know, maybe height is less maybe not...
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</body>
body {
/* background image - height: 400px */
backgroud: url('images/bg.jpg') repeat-x;
}
#content {
backgorund: #0f0;
margin: auto;
width: 900px;
margin-top: 150px;
}
.clear {
clear: both;
}
.wrapper {
width: 100%;
}
我想在内容的左下角获得白色(例如),在右下角获得红色(例如)。底部的意思是,当背景正文结束时,到页面的末尾。如果我知道内容的高度,那么我可以插入一个绝对值(右:0px;宽度为 50%)的 div。