Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have the following CSS code in my style sheet:background-image:url("~/media/1003/kappe-kort.gif")
But in the generated style sheet sent to the server, the tilde is still there in literal form, cuasing the browser to look for /css/~/media/1003/kappe-kort.gif rather than /media/1003/kappe-kort.gif.
Usingbackground-image:url("/media/1003/kappe-kort.gif")without the tilde works fine. But isn't the tilde version supposed to be more robust?
Umbraco 7.1.8ASP.NET MVC 4Windows 7 pro SP1IIS 7
The ~/ root is a server side feature of .NET. In the HTML output from the server it will be replaced with the root application file path in HTML.
It is deemed more robust because it means your application could still work in a sub folder or root directory if required.
CSS is not run at the server side so you can't actually use the ~ in .css files. Stick with / and amend your CSS if the application is ever moved to a sub folder.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted