CSS BODY {...} attributes

admin

Administrator
Staff member
I have a main "style.css" sheet that my pages link to. In it I have at some point or another defined the BODY tag as having the following attributes:
color:#c0c0c0 - should give me a grey background
background:#c0c0c0 - should give me a grey background
background-color:#c0c0c0 - it should give me grey
background-image:url(images/gray.gif) - a 1x1 grey pixel
{not all at once - tried with all of these...}

I have some DIV tags setup with the same background and some positioning information - these work and put stuff where I want with a neutral grey background.

But I have a white border in-between the DIV sections!!:mad: Anyone have any ideas how to get rid of it?
(If I use in-line style - ie use BODY bgcolor=#c0c0c0 - then it greys out the white bits. :confused: )

A page on the site I'm trying to get working: <!-- w --><a class="postlink" href="http://www.memorabilia4u.com/hot.shtmlI'm">www.memorabilia4u.com/hot.shtmlI'm</a><!-- w --> getting a 404 on the page and a 403 on the entire domain - is it the uni security settings or doesn't the link work?oops: <!-- w --><a class="postlink" href="http://www.memorabilia4u.com/Hot-01.shtml">www.memorabilia4u.com/Hot-01.shtml</a><!-- w --> (<!-- m --><a class="postlink" href="http://www.memorabilia4u.com/Hot-01.shtml">http://www.memorabilia4u.com/Hot-01.shtml</a><!-- m -->)
(the security is the next thing to sort out...:rolleyes: )when using external css remove all the html tags.
i.e. take out the <style> tags and everything else that's not css.

Does that help?I don't know why you have:

background: #c0c0c0

and

background-color: #c0c0c0

Here, I'll clean up your code a little, and maybe this might just fix it:


body {
color: #c0c0c0 - This is grey text
background: #c0c0c0 url(images/gray.gif); - this is a grey bg and bg image
}


"color: #c0c0c0" changes the color of your font, not your background.

Hope this helpsOriginally posted by DaveSW
when using external css remove all the html tags.
i.e. take out the <style> tags and everything else that's not css.

Does that help?
So the .css file should just be...

BODY {background.....

and not

<STYLE TYPE="text/css">
<!--
BODY { background

? Yes?

I don't know why you have:...
I don't; it was a list of things I had tried (in vain) to get something to happen.
I'll take out the <style> tags in the css and see what happens :cool::( nope.

Any other suggestions?Can you update your online file? I assume it's this one: <!-- m --><a class="postlink" href="http://www.memorabilia4u.com/Style.css">http://www.memorabilia4u.com/Style.css</a><!-- m -->

The entire file should look like:

BODY { color:Black; text:#000000; topmargin:0; marginwidth:0;}

.STitle { font-size:12pt; font-weight:bold; font-family:arial; color:#ffffff;}

.Filter_For { width:200px; background:#ffffff; color:#000000;}
.Filter_On { width:200px; background:#aaaaaa; color:#ffffff;}
.Suggest { font-size:10pt;}

A:link { text-decoration:none; color:white; }
A:hover { color:black; }
A:active { text-decoration:none; color:black; }
A:visited { text-decoration:none; color:gray; }

.live { font-size:14pt; font-weight:bold; font-family:arial; color:#ffffff; }
.dormant { font-size:10pt; font-family:arial; color:#ffffff; }

.Navigation { font-size:10pt; font-weight:bold; font-style:Italic;}

H2 { font-size:14pt; font-weight:bold; font-family:arial; color:#000000;}

TD { font-size:12pt; font-weight:normal; font-family:arial; color:#000000;}

Address { text-indent:20px;}

DIV { PADDING: 0px; background-color:#C1C1C1; POSITION: absolute; TEXT-ALIGN: center; }

DIV.Tite {
LEFT: 0px; TOP: 0px; HEIGHT: 150px;
}
DIV.Menu {
LEFT: 0px; TOP: 150px; WIDTH:100px;
}
DIV.List {
LEFT: 120px; TOP: 150px;
}
DIV.Body {
LEFT: 0px; TOP: 150px;
}
DIV.Note {
LEFT: 0px; BOTTOM: 0px; HEIGHT: 100px; WIDTH:100px; POSITION: fixed;
}

After you've changed that then validate your stylesheet
<!-- m --><a class="postlink" href="http://jigsaw.w3.org/css-validator/Sorry">http://jigsaw.w3.org/css-validator/Sorry</a><!-- m -->: my FTP client didn't upload the file; it just sat it in a queue. :rolleyes:

Thanks for the link - I think that's what was causing it; with the <STYLE... in there, the BODY was becoming part of the unrecognised tag.


Cheers. :Dnp and good luck!
 
Back
Top