2014-05-05 116 views
0

我有3個背景圖像和顏色,我想放到一個模擬了網頁,但是我不能讓他們顯示在所有的,這裏是我使用的CSS:多個CSS背景

body{ 
    #FF0, 
    url(../Pictures/midal_foot_img_lg.png) bottom center no-repeat, 
    url(../Pictures/banner.png) center no-repeat, 
    background:url(../Pictures/header2.png) top center no-repeat; 
} 
+0

嘗試刪除',''之後#FF0' –

+1

[多個背景圖像和背景顏色(可能重複http://stackoverflow.com/questions/5427371/multiple-background-images -and-a-background-color) –

回答

1

我覺得你的語法是不正確的,試試這個:

body { 
    background: 
     url(../Pictures/midal_foot_img_lg.png) bottom center no-repeat, 
     url(../Pictures/banner.png) center no-repeat, 
     url(../Pictures/header2.png) top center no-repeat; 
    background-color: #FF0; 
} 

Source

+1

背景顏色需要最後纔會被覆蓋。或者移動下面的背景顏色聲明,或者將'#FF0'放在背景值的最後。 – BoltClock

+0

感謝您發現,我會更新我的答案。 –

+0

謝謝你們,讓我擺脫了棘手的局面 –

0

CSS屬性名必須值之前去。在你的情況背景下。你也可能想看看Barnee指出的問題。

body{ 
     background:    
     url(../Pictures/midal_foot_img_lg.png) bottom center no-repeat, 
     url(../Pictures/banner.png) center no-repeat, 
     url(../Pictures/header2.png) top center no-repeat, 
     #FF0 
    }