Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Relative Path Solution for Master Pages

0.00/5 (No votes)
20 Feb 2012 1  
A relative path solution for master pages.

If you are having issues with your web pages not displaying background images and you are using a masterpage, the problem could be because the path to the image is relative to the page itself and not the masterpage.


To fix this issue, add a link to a CSS file in your masterpage instead of using inline styles.


XML
<link href="css/Main.css" rel="stylesheet" type="text/css" />

This makes the image path become relative to the linked CSS file instead of the page.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here