Example

A simple <h1>-<h6> tags:

Laboratory

description & Usage

The <h1> to <h6> tags stand for heading and are used to define headings (titles) in a web page.

In HTML, we have six levels of headings:

  • <h1></h1>
  • <h2></h2>
  • <h3></h3>
  • <h4></h4>
  • <h5></h5>
  • <h6></h6>

<h1> has the highest importance, and <h6> the least.

description tag
To specify the main titles <h1> - <h6>

For emphasis on text

Italic style

Equal to <strong>

<em>

 

 

For important texts

Bold style

Equal to <em>

<strong>

 

 

For important texts

Highlight style

Less than <strong>

<mark>

 

 

to mark

Bold style

unimportant

<b>

 

 

Notes

Note: The <h1> tag should only be used once per page and it should contain the main title of the page.

Note: The <h2> to <h6> tags can be used multiple times per page and they should contain subheadings of the page.

Note: When using headings, heading order is important. Start with <h1>, then <h2>, then <h3>, and so on in numerical order.

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
<h1> - <h6>

Global Attributes

The <h1>-<h6> tag supports the HTML Global Attributes.

Event Attributes

The <h1>-<h6> tag supports the HTML Event Attributes.

Default CSS

Most browsers will display the <h1>-<h6> tag with the following default style: