Click to See Complete Forum and Search --> : body class?


screaming_banjo
11-08-2005, 04:24 PM
I'm guessing this isn't possible, I'm writing a site where I want index.htm to have a black background, every other page will have the same background apart from this.

I thought it would just be a case of defining:

body.index (background-color: #000000;}

then using the class index....but nope! I've also tried .index etc...

Is there a way around this without a separate style sheet?

Thanks!

jogol
11-08-2005, 04:42 PM
use <body id="idname">

and

#idname {background: #000}

LiLcRaZyFuZzY
11-08-2005, 05:24 PM
as you won't have many bodies elements in your document, you may as well select it as:

body{
background-color: #000;
}

jogol
11-08-2005, 05:36 PM
i think he wants to do

<body id="index">

body{
background-color: #somecolor; /*all pages except index*/
}

#index{
background-color: #000;
}

Robert Wellock
11-09-2005, 10:10 AM
I thought screaming_banjo was a she the last time I noticed but anyway just use the id method.

JPnyc
11-09-2005, 10:48 AM
You can also define the style inline <body style="background-color:chartreuse"> or whatever floats yer boat