這應該工作。我只會讓綠色成爲可重複的圖像,並使用背景顏色來製作紅色(以下以「紅色」表示)。
CSS
body {
position: relative;
}
#left {
background: red url(/yourleftimagefile) bottom left repeat-x;
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 50%;
z-index: 0;
}
#right {
background: red url(/yourrightimagefile) top left repeat-x;
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 50%;
z-index: 0;
}
#center {
position: relative;
z-index: 1;
width: 960px;
margin: 0 auto;
}
HTML
<div id="#center"></div>
<div id="#left"></div>
<div id="#right"></div>
的HTML呈現靈活的高度,#center
但它可以由一個固定的高度。
請你可以使用漸變圖像截圖 – sandeep
下面是一個截圖,顯示了一個基本的例子。藍色是主頁面佈局。綠色/紅色漸變需要擴展全瀏覽器寬度。 http://img.skitch.com/20111122-ts119qpcus7ttjitj8cnp1r3u9.png – Zoolander