<h1>...</h1> to <h6>...</h6>

HTML4 HTML5

Defines hierarchical headings on a webpage. The <h1> tag represents the highest level heading (most important, usually one per page), whereas <h6> represents the lowest level.

Both opening and closing tags are required for each heading level.

Attributes: Global attributes are primarily used, such as class, id, and style.

Example

Code:

<h1 style="margin: 5px 0; color: #2c3e50;">Heading Level 1 (h1)</h1> <h2 style="margin: 5px 0; color: #34495e;">Heading Level 2 (h2)</h2> <h3 style="margin: 5px 0; color: #7f8c8d;">Heading Level 3 (h3)</h3>

The browser will interpret this code as follows:

Heading Level 1 (h1)

Heading Level 2 (h2)

Heading Level 3 (h3)