CSS中的参考背景图像-IIS中的应用程序MVC 3 ASP.NET
我在IIS中托管了一个应用程序 但不处理CSS文件中的背景图像 css从布局中引用,带有:CSS中的参考背景图像-IIS中的应用程序MVC 3 ASP.NET,css,asp.net-mvc-3,layout,Css,Asp.net Mvc 3,Layout,我在IIS中托管了一个应用程序 但不处理CSS文件中的背景图像 css从布局中引用,带有: <link href="@Url.Content("~/Content/themes/NewStyleSUPERADMIN/style.css")" rel="stylesheet" type="text/css" /> 或 background-image: url('/content/themes/NewStyleMeduimHarder/images/Bottom_texture.j
<link href="@Url.Content("~/Content/themes/NewStyleSUPERADMIN/style.css")" rel="stylesheet" type="text/css" />
或
background-image: url('/content/themes/NewStyleMeduimHarder/images/Bottom_texture.jpg');
如何显示图像?使用相对路径:
在css中,您应该只使用
url(../images/Bottom\u texture.jpg)
据我所知,您还应该将css的url更改为@url.Content(“~/Content/themes/NewStyleSUPERADMIN/style.css”)
url应该是
url(themes/NewStyleMeduimHarder/images/Bottom_texture.jpg)
关于内容文件夹。这是对我有效的答案。我把图像放在一个名为“images”的文件夹中,然后我把它放在:
url(“../images/nameofpicture.gif”)
background-image: url(images/Bottom_texture.jpg);
url(themes/NewStyleMeduimHarder/images/Bottom_texture.jpg)