2017-04-07 45 views
-3

我的網頁(即時學習網頁)的背景分爲兩部分。爲什麼我的網頁在背景中有分色

enter image description here

這裏是CSS代碼

body { 
    background: #466368; 
    background: -webkit-linear-gradient(#648880, #293f50); 
    background: -moz-linear-gradient(#648880, #293f50); 
    background:   linear-gradient(#648880, #293f50);  
} 
+1

could y ou請發佈本部分中使用的所有HTML和CSS代碼? – Lucian

回答

0

我解決

body{ 
    background: #466368; 
    background: -webkit-linear-gradient(#648880, #293f50); 
    background: -moz-linear-gradient(#648880, #293f50); 
    background:   linear-gradient(#648880, #293f50); 
    margin: 0px; 
    height: 100%; 
    min-height: 100%; 
} 

html{ 
    margin: 0px; 
    height: 100%; 
} 
+0

似乎分裂了,因爲你的'線性漸變'正在考慮你的內容的'高度',然後再重複。只需設置「no-repeat」http://codepen.io/anon/pen/mWZrdo – DaniP

+0

不起作用。 botton部分現在是白色的,我通過添加'margin:0px; 身高:100%; 分鐘高度:100%;' 和'html { margin:0px; 身高:100%; }' –

1

你的背景是由於重複對身體的高度試試這個問題:

body { 
    background: #466368 no-repeat center center fixed; 
    background: -webkit-linear-gradient(#648880, #293f50) no-repeat center center fixed; 
    background: -moz-linear-gradient(#648880, #293f50) no-repeat center center fixed; 
    background: linear-gradient(#648880, #293f50) no-repeat center center fixed; 
} 
+0

它的工作!謝謝!! –

相關問題