2013-12-15 47 views
1

我正在製作一個社交網絡,我正在使用linear-gradient(#dadae3, white)。這可以工作,但底部顯示顏色爲#dadae3的底部部分。我沒有這個部分的元素。灰色部分出現在底部

截圖:

enter image description here

我要尋找一個解決方案來擺脫這個灰色部分。謝謝!

+0

,由於傾斜度不覆蓋整個元素,你的頁面的背景是#dadae3是最有可能。在CSS中尋找元素'body'或'html'的樣式。 –

+1

一個小提琴或codepen會很好。 – Moin

+0

或至少你的一些代碼! – vals

回答

1

你的背景漸變只是重複的,因爲缺乏body元素(我假設你使用的梯度body元素),還請確保您已設置的height有你background-repeatno-repeat

Demo

html, body { 
    height: 100%; /* Setting both the elements height to 100% */ 
} 

body { 
    background-repeat: no-repeat; 
    /* mmmm not required as we have set to fixed but than too no harm using it */ 
    background-attachment: fixed; /* Fixes background for you */ 
    background: linear-gradient(#dadae3, white); 
} 
0

這可能是background-colorbody或頁面html元素!

而漸變只是覆蓋在您的網頁div!檢查css的body或html(或此元素的父級)。

您可能還想檢查footer CSS屬性!

試試這個一檢查:

html, body, footer { 
    background-color: transparent; // remove the background.. 
}