Validating CSS
Validating your CSS ensures compliance with W3C standards and makes for more consistent rendering in a variety of compliant browsers across platforms.
While error messages aren’t always poetry, the validator provides you with consultation from an (X)HTML and CSS expert for the price of a dirty look.
Common mistakes
To minimize tail-chasing, correct errors and revalidate one problem at a time.
- Match like units (
margin {50px 10% 10px 20%}) - Separate multiple declarations with (
;) (padding-top: 40px; padding-bottom: 10px) - Separate multiple selectors with (
,) (h1, h2, h3 {border-bottom: 1px solid #000})
Flavors of the validator
The free W3C CSS validator is located at: http://jigsaw.w3.org/css-validator/
If you wish to validate your CSS offline:
File upload: http://jigsaw.w3.org/css-validator/validator-upload.html
Text area: http://jigsaw.w3.org/css-validator/validator-text.html.
Validate CSS that is on-line by entering the URL at: http://jigsaw.w3.org/css-validator/validator-uri.html.