Round_Butte
asked on
How do I add a background to a cascading style sheet?
I have some code of a cascading style sheet that I would like to put a back ground in the website that it references but I don't have the website it references. I have the background image on disk, how do I code in the background image in the CSS code? John
To add to jason1178's solution, you can add no-repeat at the back or repeat-x repeat-y for repeating or no repeating of background image, eg:
.someclass
{
background: url(images/file.gif) no-repeat;
}
Hop ethis helps.
.someclass
{
background: url(images/file.gif) no-repeat;
}
Hop ethis helps.
If you background is for the body element (i.e. the page background on every page), then you can assign this directly to the BODY:
body {
background:white url(somedirectory/myimage.jpg) no-repeat top left;
}
Hey, look who found the new code snippet feature. :)
Yes...
<opinion>
But not very useful for when I'm including multiple chunks of code!
</opinion>
ASKER
So I use url() regardless if its on the web or hard disk? John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you
ASKER
So I have to build a folder for my files????
glad to help!
.someclass {
background: url(images/file.gif)
}