Using the style below (css file is linked to Default.aspx, which is then plugged into its master page), i want to control the color, repetition and image. The first two work fine but the image doesn’t display.
body{
background-color: #000000;
background-image: url('images/bg_01.jpg');
background-repeat: no-repeat;
}
When i add a style explicitly to the body tag on the master page, it works but boy it sure looks ugly. Why does it happen? How can i kill it?
<body style="background-image: url('images/bg_01.jpg');">
...
</body>
When using
background-image: url()in a CSS file, make sure that the image path in the CSS is relative to the path of the CSS file, and not relative to the page the CSS is being used in.For instance, if your CSS file is located in
/styles/mystyle.cssand your image is located in/images/image.jpgthen your url should be…