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

ValidationValidation

Every punctuation mark, attribute, and tag - the tag name, opening, closing, or bracket - is crucial in code. However, it can be difficult 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: Validators ensure the HTML code follows the correct syntax rules;
  • Adherence to specified standards: Validators verify if the code conforms to the established HTML standards, such as HTML5;
  • Tag spelling correctness: Validators check if the tags are spelled correctly;
  • Attribute usage correctness: Validators ensure that attributes are used correctly within the HTML tags;
  • Tag opening/closing correctness: Validators check if tags are correctly opened and closed;
  • Tag nesting correctness: Validators verify if 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.html

css

index.css

js

index.js

Paste the code into the validator's window between the opening and closing <body> tags. Then, click the "Check" button.

content

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.

content

Let's fix all the errors in the code example:

html

index.html

css

index.css

js

index.js

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 ...

Selecione a resposta correta

Tudo estava claro?

Seção 2. Capítulo 11

ValidationValidation

Every punctuation mark, attribute, and tag - the tag name, opening, closing, or bracket - is crucial in code. However, it can be difficult 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: Validators ensure the HTML code follows the correct syntax rules;
  • Adherence to specified standards: Validators verify if the code conforms to the established HTML standards, such as HTML5;
  • Tag spelling correctness: Validators check if the tags are spelled correctly;
  • Attribute usage correctness: Validators ensure that attributes are used correctly within the HTML tags;
  • Tag opening/closing correctness: Validators check if tags are correctly opened and closed;
  • Tag nesting correctness: Validators verify if 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.html

css

index.css

js

index.js

Paste the code into the validator's window between the opening and closing <body> tags. Then, click the "Check" button.

content

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.

content

Let's fix all the errors in the code example:

html

index.html

css

index.css

js

index.js

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 ...

Selecione a resposta correta

Tudo estava claro?

Seção 2. Capítulo 11
some-alt