2012-10-25 28 views
1

應用MVC 3 ASP.NET我有一個應用程序託管在IIS參考背景圖像 - 在IIS

enter image description here

而不是從CSS文件工作背景圖像

該css是從佈局中引用的:

<link href="@Url.Content("~/Content/themes/NewStyleSUPERADMIN/style.css")" rel="stylesheet" type="text/css" /> 

style.css,我有:

background-image: url('/content/themes/NewStyleMeduimHarder/images/Bottom_texture.jpg'); 

background-image: url('/content/themes/NewStyleMeduimHarder/images/Bottom_texture.jpg'); 

如何顯示圖像?

回答

1

在CSS,你應該只使用url(../images/Bottom_texture.jpg)

而據我可以看到你也應該改變的URL css來@Url.Content("~/Content/themes/NewStyleSUPERADMIN/style.css")

+0

這是爲我工作的答案。我將這些圖像放在名爲「Images」的文件夾中。然後我放入這個:'url(「../ Images/nameofpicture.gif」)'' –

0

URL應該

url(themes/NewStyleMeduimHarder/images/Bottom_texture.jpg) 

關於Content文件夾。