Skip to main content

Practical Exercise 2: How to Use HTML Heading Tags (h1 to h6)

In this practical HTML exercise, we will learn how to use heading tags. From the English word heading, these tags begin with the letter h and range from h1 to h6. Headings<h1>They should be used for the main headings, followed by the headings<h2>, then the least important<h3>and so on.

<h1>define the most important heading.<h6>Define the least important heading.

tip

It's good practice for each page of your website to have "at least" and "only one" heading element.<h1>.

Headings are important

Search engines use headings to index the structure and content of your web pages.

caution

Use HTML headings only for titles. Do not use headings to make text larger or bold.

Activity

Create an HTML document that uses all the heading tags from<h1> to <h6>

Interactive Solution

Solution with complete HTML code

HTML
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<title>Encabezados</title>
</head>
<body>
<h1>Encabezado 1</h1>
<h2>Encabezado 2</h2>
<h3>Encabezado 3</h3>
<h4>Encabezado 4</h4>
<h5>Encabezado 5</h5>
<h6>Encabezado 6</h6>
</body>
</html>
info

📘Learn more about this topic here👉 Fundamental elements in HTML.