HTML5 is a computer language , and it has therefore its own vocabulary, syntax and grammar. However, there are times when the documents written in HTML5 do not complain those grammar rules, and therefore they are considered invalid HTML5 web sites.
The action of verifying whether an HTML5 markup follows the HTML5 syntax rules is called "Validation". Thus, Validity is considered a quality criteria for an HTML5 web page.
We'll make use of the best HTML5 validator: the free tool by the W3C Consortium. It is called HTML5 Markup Validator :
W3C Free Tool for HTML5 Markup Validation
First browse to the HTML5 Markup Validator web site:
Once there, select the "Validate by direct input" tab:
Open your HTML5 markup:
Copy the HTML5 markup and paste it inside the text box at the W3C Markup Validator:
Essentially , you'll get the validation information. However, when you click the "Check" button, you may receive a list of validation errors:
Now is time to fix the validation errors. Scroll down the validator to see the errors that were found:
As you can see, the errors found in this sample case, refer to an Attribute not found in HTML5 syntax. That's because were using here the AngularJS Framework for building SPA (Single Page Applications) apps. Let's fix it by replacing all "ng-xxx" attributes with "data-ng-xxx":
After you fixed all the specific errors on your web page , copy-paste again the resultant markup into the Validator:
Now Check the HTML5 document. Hopefully it is now "valid" :
That All!!! In this article we learned Step by Step How to perform HTML5 Markup Validation in 5 minutes.
by Carmel Schvartzman
כתב: כרמל שוורצמן