View Full Version : Background Help


Anjelik
04-01-2006, 04:31 PM
Okay, I reeeeeallly need help here. I was putting up the layout for my site so I can start putting graphics and everything that makes it a site on there, but the background won't work! It's driving me bonkers. I know I must be doing something wrong, but I can't figure out what. Any help would be appreciated. Here's the code I'm using:
<style type="text/css">
background-color:black;
background-image:url("http://i49.photobucket.com/albums/f265/StarmiztCrush/background.jpg");
background-repeat:no-repeat;
background-position:center center;
</style>

The background's not showing up. :confused:

Chris
04-01-2006, 04:41 PM
Try changing it to:

<style type="text/css">
body{
background-color:black;
background-image:url("http://i49.photobucket.com/albums/f265/StarmiztCrush/background.jpg");
background-repeat:no-repeat;
background-position:center center;}
</style>

Anjelik
04-02-2006, 09:36 AM
Oh, wow! That worked! Thanks so much! =)

Chris
04-02-2006, 02:23 PM
You're welcome :D

war59312
04-03-2006, 04:30 AM
Hey,

Just so you know. All css must belong to a class.

Body is a class. And in html its the default class but the html parser does not assume thats what you mean. Thats why it worked after you added body to it.

Just thought Id clear up any confusion. ;)

Take Care,

Will

J to the izzosh
04-04-2006, 04:02 AM
All css must belong to a class... Body is a class.

Careful, there. "Body" is an element name, ".myclass" is a class, and "#myid" is an ID. These are all examples of selectors, in which all styles must be defined. ;)