2015-04-02 135 views
0

這可能看起來很簡單,但我試圖使一個div背景變白,我不能!做一個背景白色

你可以看到一個發展中的網站就在這裏:

http://www.issencial.com/2015/

我有一個視頻的背景下,以資產淨值(RT-頭)一個div,然後一個div(RT-功能),我想白所以當人們向下滾動時,它與視頻重疊。

我想這是所有設置,但只有內容是白色的,而不是整個DIV ...

誰能幫助我在這?

提前感謝...

+3

將'position:relative;'添加到div('#rt-feature')。 – naththedeveloper 2015-04-02 11:55:40

+0

根據@ɴᴀᴛʜ建議設置位置相對將修復它 – 2015-04-02 11:57:30

+0

是的,這是正確的!位置:相對解決它... 非常感謝你們! – 2015-04-02 15:07:29

回答

0

這應該是它:

#rt-feature { 
background: none no-repeat scroll 0 0 #fff; 
position: relative; 
} 
0

是否......

background-color:white; 

的 「RT-網12 RT-αRT-ω」 達到你要的效果?

0

您沒有指定絕對位置,所以默認情況下它的位置是 :static。該元件相對於定位到它的第一positioned.And,而不是使用後臺只使用背景顏色,因爲它與下面的代碼

#rt-feature { 
background-color: #ffffff; 
width: 100%; 
position: absolute; 
} 

    #rt-header { 
    background-color: #ffffff; 
    box-shadow: 0 1px 2px #000000; 
    position: fixed; 
    width: 100%; 
    z-index: 99; 
    } 
+0

請解釋代碼而不是隻發佈代碼。 – 2015-04-02 12:16:02

0

添加CSS屬性div.Try

#rt-feature { position: relative;}