我正在使用一個網站並在中間使用960容器,現在唯一的問題是設計師在某些div
s上使用了不同的背景顏色。將div的背景拉伸到容器內部的全寬
所以我現在的代碼是:
<div id="content">
<!-- the content needs to 960 on the width only the background need the full width of the page -->
<div class="whitebackground">
<!-- content -->
</div>
<div class="bluebackground">
<!-- content -->
</div>
</div>
CSS:
#content {
margin: 0px auto;
min-height: 700px;
position: relative;
width: 960px;
}
.whitebackground{
width: 100%;
background:#FFF;
}
.bluebackground{
width: 100%;
background:#0054fe;
}
現在的問題是div
的背景顏色s-當然只是內容div
內。有什麼方法可以讓div
的顏色超出內容div
的範圍,並使頁面變爲全角?
這裏是工作的代碼http://jsfiddle.net/6cJVV/
我看到這個權利嗎? 您想將div的背景拉伸到另一個div的大小? – lukasgeiter
不,我想伸展另一個div的div的背景 – Ivo