2011-05-03 33 views

回答

8

您似乎在文件名前面缺少url。它應該是:

body {background-image: url(source-file.png);} 

請注意,我也用background-image這裏,不background。您可以使用background快捷方式,那麼它會是這個樣子:

body {background: transparent url(source-file.png) left top no-repeat;} 

它也更通常把背景上body標籤,但我敢肯定,html標籤在大多數情況下工作,以及。

1

不知道如果這是造成問題,但你需要在括號前面加上「url」。也許不會傷害,使身體有背景。最後,只要「背景」屬性可能需要更多輸入,因爲您一次設置了幾件事情(並且您只是試圖製作bg圖像)。所以:

html { background-image : url("source-file.png"); } 

body { background-image : ("source-file.png");} 

欲瞭解更多信息,請參閱:

http://www.w3schools.com/css/pr_background.asp

讓我們知道,如果這些解決方案解決您的問題。

+0

是的,我們使它的使用身體屬性,謝謝。 – scohoe 2011-05-03 21:55:27