Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Validation | Tags and Attributes
Ultimate HTML
course content

Course Content

Ultimate HTML

Ultimate HTML

1. Web Development
2. Tags and Attributes
3. Document Structure
4. Media and Tables
5. Forms

book
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:

html

index

css

index

js

index

copy

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:

html

index

css

index

js

index

copy

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.

Validator ...

Validator ...

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 10
We're sorry to hear that something went wrong. What happened?
some-alt