CSS WAS valid...now generating warnings!?

Roo's picture

She has: 840 posts

Joined: Apr 1999

What the hell!?

I've not edited anything anywhere, but suddenly my style sheets *everywhere*. are generating warnings!

Therse were perfectly fine before!

Here are the warnings from my previously fine weblog:

* Line : 8 (Level : 2) Redefinition of margin-left : body
* Line : 9 (Level : 2) Redefinition of margin-right : body
* Line : 10 (Level : 2) Redefinition of margin-top : body
* Line : 11 (Level : 2) Redefinition of margin-bottom : body
* Line : 23 (Level : 1) You have no background-color with your color : p
* Line : 30 (Level : 1) You have no background-color with your color : .italic
* Line : 37 (Level : 1) You have no background-color with your color : H1
* Line : 41 (Level : 1) You have no background-color with your color : a:link
* Line : 42 (Level : 1) You have no background-color with your color : a:visited
* Line : 43 (Level : 1) You have no background-color with your color : a:hover
* Line : 45 (Level : 1) You have no background-color with your color : a.newcolor:link
* Line : 46 (Level : 1) You have no background-color with your color : a.newcolor:visited
* Line : 47 (Level : 1) You have no background-color with your color : a.newcolor:hover
* Line : 55 (Level : 1) You have no color with your background-color : .tdback
* Line : 61 (Level : 1) You have no color with your background-color : .tdback2
* Line : 67 (Level : 1) You have no color with your background-color : .tdside
* Line : 116 (Level : 1) You have no background-color with your color : .icon
* Line : 135 (Level : 1) You have no background-color with your color : .text
* Line : 143 (Level : 1) You have no background-color with your color : .links
* Line : 149 (Level : 1) You have no background-color with your color : .heading
* Line : 155 (Level : 1) You have no background-color with your color : .posthead
* Line : 161 (Level : 1) You have no background-color with your color : .copyright
* Line : 167 (Level : 1) You have no background-color with your color : .emp
* Line : 177 (Level : 1) You have no background-color with your color : .author
* Line : 187 (Level : 1) You have no background-color with your color : H5
* Line : 198 (Level : 1) You have no color with your background-color : .input
* Line : 199 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .input
* Line : 208 (Level : 1) You have no color with your background-color : .textarea
* Line : 209 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .textarea
* Line : 223 (Level : 1) You have no background-color with your color : .header
* Line : 230 (Level : 1) You have no background-color with your color : .navlinks a:hover
* Line : 230 (Level : 1) You have no background-color with your color : .navlinks a:hover
* Line : 230 (Level : 1) You have no background-color with your color : .navlinks a:hover
* Line : 230 (Level : 1) You have no background-color with your color : .navlinks a:hover
* Line : 230 (Level : 1) You have no background-color with your color : .navlinks a:hover
* Line : 235 (Level : 1) You have no background-color with your color : .navlinks a:link
* Line : 236 (Level : 1) You have no background-color with your color : .navlinks a:visited
* Line : 237 (Level : 1) You have no background-color with your color : .navlinks a:active
* Line : 238 (Level : 1) You have no background-color with your color : .navlinks a:hover
* Line : 246 (Level : 1) You have no background-color with your color : .weekdays
* Line : 254 (Level : 1) You have no background-color with your color : .monthdays a:hover
* Line : 254 (Level : 1) You have no background-color with your color : .monthdays a:hover
* Line : 254 (Level : 1) You have no background-color with your color : .monthdays a:hover
* Line : 254 (Level : 1) You have no background-color with your color : .monthdays a:hover
* Line : 254 (Level : 1) You have no background-color with your color : .monthdays a:hover
* Line : 256 (Level : 1) You have no background-color with your color : .monthdays a:link
* Line : 257 (Level : 1) You have no background-color with your color : .monthdays a:visited
* Line : 258 (Level : 1) You have no background-color with your color : .monthdays a:active
* Line : 259 (Level : 1) You have no background-color with your color : .monthdays a:hover

What am I supposed to do? Add background-color: none; or something? That seems dumb to me....extra lines for no reason.

Roo

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

What you have a color:; with no background:; the validator gives a warning, so just do something like this:

color:#000;
background-color:inherit;
'

or

background-color:#000;
color:inherit;
'

Roo's picture

She has: 840 posts

Joined: Apr 1999

Yeah, but when did that start? These always validated perfectly until now.

Busy's picture

He has: 6,151 posts

Joined: May 2001

It's just a warning not an error, if your worried about file size just ignore it, otherwise as Renegade suggests.
Has been like that for a while, they seem to keep changing the goal posts

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

That doesn't make any sense. I'd ignore it. It's like the accessibility validator (forget what it's called) that give you a warning on every gif in case it might be flashing and causing seisures Roll eyes Why should you have to have a background color with your color? No reason!

Actually, I would complain to the w3c that stuff like that is making your CSS un-valid.

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

When someone checks it does it still say it is valid CSS (with warnings) or invalid?

-Greg

Roo's picture

She has: 840 posts

Joined: Apr 1999

It says it's valid but then lists the warnings underneath. I don't like warnings! Im anal like that!

He has: 698 posts

Joined: Jul 2005

Yeah, I receive a lot of warnings like that too. I would simply worry about whether or not it is valid. If you seriously want everything to be right, then correct the warnings, but that is a big pain in the butt and isn't that worth it to tell you the truth. Smiling

Kurtis

They have: 27 posts

Joined: Sep 2005

I agree...

Warnings aren't necessarily bad, I just like my HTML to be valid.

Roo's picture

She has: 840 posts

Joined: Apr 1999

Okay well once you use shorthand in the body for margins, and declare background-color in *everything* warnings disappear. Dumb, dumb, dumb.

JabezDesign's picture

He has: 3 posts

Joined: Apr 2005

The main reason why CSS is changing when validating is for the new browsers that will and are coming out, especially IE7.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.