Reputation: 30671
I am using the following code, but it is having no effect!! Can this be done?
html {
background: #d9dbdc url('images/repeat-x.png') repeat-x;
}
Upvotes: 0
Views: 101
Reputation: 449395
This will work if you actually have an image at the specified location, although it's usually applied to the body
element. It could be that the body element has a background colour that is covering the image.
Note that paths are relative to the style sheet file, not the HTML file embedding it, so a path pointing to images/repeat-x.png
in /css/styles.css
would result in /css/images/repeat-x.png
.
Upvotes: 2
Reputation: 3777
If you are trying to set the background of the entire page I'd recommend:
body { background: #d9dbdc url('images/repeat-x.png') repeat-x; }
Upvotes: 1
Reputation: 6173
make sure the url is correct, you can use browser debug tool like Firebug in firefox to inspect the html
Upvotes: 0
Reputation: 887295
Yes, it can be done, but it needs to be on the <body>
tag.
Your image might not exist, or you might have a different background covering it.
Upvotes: 2