Validation of code
Standard-compliant code
The validation of HTML syntax and of style sheets ensures standard compliance, which is an important contributor to accessibility.
These standards, i.e. the latest specifications for web design published by the W3C, emphasize accessibility. They recommend using correct structural mark-up and the separation of presentational instructions from structure and content.
The latest standard for coding web pages is XHTML, extensible hypertext mark-up language. HTML 4.01 was the last HTML version to be published. Although it is still in widespread use, it is a good idea to slowly move to XHTML.
Cascading style sheets (CSS) are now recommended for presentational mark-up from font and colour specifications to table-less layout.
Learn more about standards in the Techniques section
and about XHTML in the Related issues section.
W3C Validation Service
The W3C's online validation tools examine HTML and CSS for errors.
Try these validators on your own pages or any site you like.
Example:
As an example we tested a random page from the TechDis site :
This screenshot shows the HTML validator homepage. We filled in the complete web address of the page we wanted to test and left all other input fields as they were.
The second screenshot shows the results: The validator detected that this document was written using HTML 4.01 Strict and checked the code of the page against these specifications. It found no errors.
Another test, this time of the BBC News site , was initially unsuccessful because the tested page does not contain any information as to which version of HTML was used. The page could not be validated.
Returning to the validator homepage, we chose 'HTML 4.01 Transitional' from the Document type drop-down list and tried again. This time the validator returned a number of errors. The BBC News site does not validate to the chosen grammar.
We could have tried validating against another HTML version, but this example mainly shows how important it is to include the HTML version at the beginning of every document. Browsers will read these instructions and render a page accordingly. If this information is missing or incorrect browsers will experience difficulties in displaying a page correctly.
Learn more about HTML version declarations in the Techniques section.
Evaluation
[ Introduction ]
[ First impressions ]
[ Keyboard access ]
[ Different browsers ]
[ User control over presentation ]
[ Validation of code ]
[ Case studies ]
| Access Guide Home | Table of Contents | Definitions | Glossary |