The benefits of Web Standards to your visitors, your clients and you!
5. What is valid code?
Validation is a process of checking your documents against a formal standard, like those published by the W3C. A document that has been checked and passed is considered valid.
Why use valid code?
- Valid code will render faster than code with errors
- Valid code will render better than invalid code
- Browsers are becoming more standards compliant, and it is becoming increasingly necessary to write valid and standards compliant HTML
How do you check if your code is valid
- W3C Markup Validation Service
- W3C CSS Validation Service
- WDG HTML Validator
- Stylesheets.com CSS Validator
- Many software products now have inbuilt validation tools
How do you make your code valid?
- Start with the right doctype
- Be aware of doctype modes (standards compliant, quirks mode etc)
- Use a character set
- Close HTML elements
- Use alt tags for images
- Avoid HTML hacks
- Use HTML validators regularly
- Fix any bugs you find before you go live
- Make validation part of your normal work process