Course Content
Ultimate HTML
Ultimate HTML
Validation
Every punctuation mark, attribute, and tag - whether it's the tag name, opening tag, closing tag, or bracket - is crucial in code. However, it can be challenging for beginners to keep track of all of them. Fortunately, validators are available to help.
Validation aims to identify syntax errors in the markup of an HTML document. Validators are software programs that can perform these checks. After validation, we receive a successful result or a list of suggested revisions to make.
Note
It's important to note that validators do not check semantics. Instead, they focus on the following aspects:
- HTML syntax: ensures the HTML code follows correct syntax rules;
- Adherence to specified standards: verifies conformity to established HTML standards, such as HTML5;
- Tag spelling correctness: checks if tags are spelled correctly;
- Attribute usage correctness: ensures attributes are used correctly within HTML tags;
- Tag opening/closing correctness: verifies that tags are properly opened and closed;
- Tag nesting correctness: ensures that tags are appropriately nested within the HTML structure.
Let's use a popular online validator called the W3C Markup Validation Service to practice validation. Open the following link in a new tab by clicking on it: Validator
Now, let's validate a piece of code together. Copy the code provided below for testing purposes:
index
index
index
Paste the code into the validator's window between the opening and closing <body>
tags. Then, click the "Check" button.
Errors the validator identifies should be fixed in the order they are listed. While warnings are optional to correct, analyzing them and ensuring high-quality markup is good practice.
Let's fix all the errors in the code example:
index
index
index
By making these revisions, we can improve the accuracy and validity of the HTML code. Validator tools are crucial in helping developers identify and rectify syntax errors in the HTML markup.
Thanks for your feedback!