Michael Gearon

How to validate your CSS using W3C

Michael Gearon

W3C have created a free service where you can validate your CSS for free. You can also download the software and install it on your computer. This is a handy tool to have if you’re a web developer or web designer to check your code.

How is the validator updated and maintained?

The service is updated by a mixture of W3C staff, translators and volunteer developers. W3C maintains and hosts the tools. It’s a completely open source the code so it’s fine to download it, modify it and use it in your own projects. It is still a very active open source project with over 3,000 commits.

What does it check against?

The validator checks the inputted stylesheet against the CSS 2.1 specification. When looking at the CSS 2.1 spec it says that “the validity of a style sheet depends on the level of CSS used for the style sheet. […] valid CSS 2.1 style sheet must be written according to the grammar of CSS 2.1. Furthermore, it must contain only at-rules, property names, and property values defined in this specification.”

How do I do test my styles?

W3 give you 3 ways to test your CSS:

  1. Test by entering the URI of the document you want to validate
  2. Uploading your CSS file from your computer
  3. Copying and pasting into the website where you have a few options to choose from

Supporting the project

If you want to give a little back to the project and W3 you can also donate some money as well as contribute to the project.

Further reading

Michael Gearon

Written by

Michael Gearon

Senior Interaction Designer and Co-Author to Tiny CSS Projects