PDA

View Full Version : Validating your CSS


nofx1728
04-20-2006, 01:52 AM
Should I pay much attention to the warnings you get when you validate your css? I validated mine, and all the warnings I got had to either deal with no background-color: being named, no color: being named, or for having the same color in two seperate divs that are nested inside a div. Everything else is valid, my html is 100% valid, and I would like to have my css 100% valid, but that seems like a lot of extra work to go back and declare colors for all these tags.

Thanks,

nofx1728

Creative Insanity
04-20-2006, 10:52 AM
Personally I have gone right off validation as some of the reported errors are rediculous.
I mean the one you got about 2 colours the same. I got an error on a line that when checked was no code there and was a blank line.
Talk about over kill and for that reason I have lost faith on validation sites.

dthomsen8
04-20-2006, 12:17 PM
Should I pay much attention to the warnings you get when you validate your css? I validated mine, and all the warnings I got had to either deal with no background-color: being named, no color: being named, or for having the same color in two seperate divs that are nested inside a div. Everything else is valid, my html is 100% valid, and I would like to have my css 100% valid, but that seems like a lot of extra work to go back and declare colors for all these tags.

Thanks,

nofx1728

I find the same thing, lots of warnings about color or background color. Specifying color: inherit; or background-color: inherit; usually seems to make those errors go away.

It depends on what level you have warnings about background-color, though. If you have a <body> or <html> background-color, then inherit can work for all lower level tags. If you have a <body> background-image, then you may think you don't need a background color, but specifying white is safe. Why would any of that matter? It depends on what the user is specifying, especially those using non-standard user style sheets.

However, any validation error needs careful investigation, and there is sometimes something to be learned from the validation warnings.

Are you using the validations at http://www.w3.org or the ones in Dreamweaver, or elsewhere?

nofx1728
04-20-2006, 12:25 PM
I used the w3.org validator. I didn't even know dreamweaver had one, lol. Thanks for your response.

nofx1728

domedia
04-20-2006, 12:41 PM
There's a difference between Warnings and Errors, they are not the same and should be treated seperately.
Errors should be fixed, as they are errors, code that is broken.
Warnings are just that warnings.

The CSS validator at W3C has a FAQ (http://www.websitedev.de/css/validator-faq) you can check out as well.

It's always a good habit to validate your HTML and CSS, it's sometimes even makes you realize serious errors you otherwise would have overlooked.