Click to See Complete Forum and Search --> : Body bgcolor tag


tims15
06-26-2005, 01:15 PM
Quick question- me and the HTML validator are having an argument: Should the tag <body bgcolor="#f0f8ff"> go into the body section or head section of the HTML document?

BonRouge
06-26-2005, 01:21 PM
This should not be there : <body bgcolor="#f0f8ff">
Use CSS instead : body {
background-color:#f0f8ff;
}

wayne_ca
06-26-2005, 01:54 PM
The bgcolor attribute (as well as all other presentation tags and attributes) are deprecated in HTML 4.01. CSS is the accepted way to add style, color and all presentation concerns to your web pages. Just for clarity, this does not mean it won't work in browsers if you use the tags or attributes, because browsers are backwards compatible. It means that some browsers (such as braille-based browsers) will have difficulty with them. CSS remedies these problems and is now the acceptable way to do presentation.

felgall
06-26-2005, 04:25 PM
The original question was whether the body section of the document should be defined within the head or body of the document which is of course complete nonsense.

tims15
06-28-2005, 01:13 PM
I can't use CSS, because I already have an external CSS file, with that tag. It only colours around the different 'div' things, and not the whole page. Thats why I have to use the body bgcolor tag.

crh3675
06-28-2005, 01:26 PM
That's just plain silly, where're this file so we can see what you are talking about

the tree
06-28-2005, 02:02 PM
/*asterixes will apply to EVERYTHING, aint that just hoopy.*/

*{
background-color: #ddd;
}

tims15
06-28-2005, 02:16 PM
CSS file is www.bigwowwebhosting.com/bigwow.css. Go to www.bigwowwebhosting.com/serverinfo.php to see it without the body bg color tag.

NogDog
06-28-2005, 05:07 PM
If for some reason you don't want to change the CSS file, then you could just put it inline with the body tag (though I don't know why you'd want to):

<body style="background-color: #f0f8ff">

tims15
06-28-2005, 05:44 PM
I don't mind changing the CSS file, if thats better