Info
- 4 posts
- 3 voices
- Started 1 year ago by RedBull
- Latest reply from RedBull
- This topic is resolved
Changing the background image "repeat"
-
- Posted 1 year ago #
I currently am using a background image for my site that is repeated but I want to change it to something I don't want to repeat.
I can't seem to find the tag and everytime I try the following in style.css but no success:#img.source-image {
width: 100%;
position: absolute;
top: 0;
left: 0;
}Any further suggestions would be greatly appreciated,
RedBull -
- Posted 1 year ago #
Better places than here for css advice but this one is easy
http://www.w3schools.com/css/css_background.asp
no-repeat is what you want.
-
- Posted 1 year ago #
That CSS would only change an image that has the id "img" and a class "source-image", i.e.
<img id="img" class="source-image" src="...etc..." />
It seems like you're trying to make an image the full size of the page which isn't a sensible solution.The style you need to use is
background: url(theimage.jpg) left top no-repeat;and you should probably be applying it to the body
sobody { background: url(theimage.jpg) left top no-repeat; }and if you want the background to not scroll with the document
body { background: url(theimage.jpg) left top no-repeat fixed; }theimage.jpg must be relative to the style sheet or absolute.
-
- Posted 1 year ago #
Thanks
-
You must log in to post.