2014-05-08 173 views
-4

我想知道如何讓漸變背景在定義的佈局外重複。CSS重複漸變背景

http://i.imgur.com/CYk2FiE.png

所需重複水綠色和橙色,這也是梯度。

謝謝。

+0

不是漸變帶的只是一些元素(如DIV)橫跨整個頁面?如果是這樣,你可以使用適當的顏色停止線性漸變。 –

+0

需要在黑色(右側和左側)外部重複任何分辨率的部分。 – user8414

回答

0
<body> 
    <div id="header" style="width:1316px;height:80px;"> 
     <div style="width:150px;height:72px;background-color:white;float:left;">repeat</div> 
     <div id="header-internal" style="background-color:gray;float:left;"> 
      1016px 
     </div> 
     <div style="background-color:white;width:150px;height:72px;float:left;">repeat</div> 
    </div> 
    <div id="content"> 
     what repeat background header left and right? two colors different? 
    </div> 
    <div id="footer"> 
     footer 
    </div> 
    <br /> <br /> <br /> 
    Should look like: 
    <img src="http://i.stack.imgur.com/KCbiK.png" /> 
</body> 

和CSS將

body { 
    margin:0; 
    padding:0; 
} 
#header { 
    background:url("http://s10.postimg.org/jfhegkq49/bg_center.jpg") no-repeat; 
    background-position: bottom center; 
    background-color: #EFEFEF; 
background-size:100%; 
    height: 80px; 
} 

#header-internal{ 
    margin: 0 auto; 
    height: 72px; 
    width: 1015px; 
} 

#footer { 
    background-color: red; 
    height: 80px; 
    margin-top:20px; 
} 
+0

例如我的問題:http://jsfiddle.net/srCN7/ – user8414

+0

編輯我的答案,試試這個 – loli