2010-12-01 209 views
5

我在我的HTML中有一切除了背景圖像:'images/Header.jpg'; 相反,我看到了灰色的頭,但沒有圖像。我試圖消除灰色,但仍然沒有看到圖像...背景圖像不工作

#outerWrapper #header { 
border-bottom: solid 1px #628152; 
font-size: 18px; 
font-weight: bold; 
line-height: 15px; 
height: 115px; 
background-color: Grey; 
background-image: url('images/Header.jpg'); 

我怎樣才能使這項工作..請幫助..謝謝

回答

2

看一看與Firebug爲Firefox頁面。您可能無法正確加載圖像。如果這是您的問題,您還可以隨時隨地使用CSS。

2

嘗試將網址更改爲'/images/Header.jpg'

+0

不能正常工作..任何其他建議..謝謝 – user175084 2010-12-01 17:22:00

1

確定您需要'char?也許這是區分大小寫的,你有一個URL中的錯誤.. 也許background-image:url(images/header.jpg);

5

什麼是你的CSS文件的路徑和圖像的路徑?

您必須在帳戶,使用CSS url()當路徑是相對於CSS文件,而不是所請求的頁面

假設你有以下文件:

/website/index.html 
/website/templates/main.css 
/website/images/header.jpg 

比CSS必須是:

.style{background-image:url(../images/header.jpg);} /* Noticed "../"? */