Reputation: 337
I have an application hosted in IIS
But not working the background-image from CSS file
The css is referenced from the layout with:
<link href="@Url.Content("~/Content/themes/NewStyleSUPERADMIN/style.css")" rel="stylesheet" type="text/css" />
in the style.css, I have:
background-image: url('/content/themes/NewStyleMeduimHarder/images/Bottom_texture.jpg');
or
background-image: url('/content/themes/NewStyleMeduimHarder/images/Bottom_texture.jpg');
How do I display the image?
Upvotes: 3
Views: 4200
Reputation: 1329
The url should be
url(themes/NewStyleMeduimHarder/images/Bottom_texture.jpg)
With respect to the Content folder.
Upvotes: 0
Reputation: 2348
In the css you should only use url(../images/Bottom_texture.jpg)
And as far as I can see you should also change the url to the css to @Url.Content("~/Content/themes/NewStyleSUPERADMIN/style.css")
Upvotes: 1
Reputation: 17743
Use a relative path. Partial urls
are resolved relative to the style sheet:
background-image: url(images/Bottom_texture.jpg);
Upvotes: 7