Is it possible to get a relative translation of the site root in the CSS file of an MVC3 application?
In .cshtml, I can use:
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
However, in CSS, I need to access the content, for example:
background-image: url('/Content/images/banner.png');
I would like to be able to get root as I can with @ Url.Content, so I can do something like this (which obviously doesn't work):
background-image: url(@Url.Content("~/Content/images/banner.png"));
source share