debbie T Designs - Web Design Made Simple
CSS Validation Service at the W3C
Lucky for us, we can use the W3C Web site for validating CSS code, just like it validates your xhtml code.
Find the main CSS Validation page at http://jigsaw.w3.org/css-validator/.
Unfortunately, using the "Upload" validator will not work very well if your page has any coding other than CSS. There will be unnecessary errors listed. The "Upload" validation service will work very nicely with external CSS files, but until then, do not use this option just yet.
For now, use the "By URI" or "With a Text Area" if you want to check your CSS.
- If you utilize the "By URI" validation, your file must be first uploaded to your hosting area. Once your page passes validation with flying colors, you can opt to keep the direct link to validate the file again and again.
- To utilize the "Text Area" validation, just copy the embedded css from your file and paste it into the text area. Do not include the
<style>tags or<!-- comments -->or other (x)html coding. - Once you validate the final version of your file, you can copy and paste the coding to show the W3C icon for validated CSS. (Note: The icon is only available when using the "For Uri" validation.)
FAQ
When I validate my CSS code, an error appears about my XHTML that I do not understand. Do you have any hints?
Answer: If you receive an error similar to this:
"Please, validate your XML document first! Line 9 Column 16 Element type "p" must be followed by either attribute specifications, >or />"
Check your tags to assure every attribute="value" is separated by a [space]. If you have bunched up attributes, the CSS validator won’t like it.
When I validate my CSS code, it passes validation, but there are warnings listed. What do the validation warnings mean?
Answer: The warnings are just that. Warnings, not errors. Each warning should be examined separately. Some can be ignored and should be addressed.
A very common CSS validation warning is that the background-color was not defined along with each color property. The warning serves as a reminder to ensure that the page has a proper background color and doesn’t rely on the browser default. If you defined background and color declarations for the body selector, then you can safely ignore any warnings on subsequent elements defined without a background-color rule.






