2012-10-25 19 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文件夹。