Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS中的参考背景图像-IIS中的应用程序MVC 3 ASP.NET_Css_Asp.net Mvc 3_Layout - Fatal编程技术网

CSS中的参考背景图像-IIS中的应用程序MVC 3 ASP.NET

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

我在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.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)