HTML Headings

HTML Headings

A heading element briefly describes the topic of the section it introduces.

Heading elements like h1, h2, h3, ... allow you to use six levels of document headings, ranging from largest to smallest, breaking up the document into logical sections

HTML has 6 levels of heading from h1, h2.....h6

Definition and Usage

Content categories flow content, heading content, palpable content
Permitted content Phrasing content
Tag omission None
Permitted parent element Any elements
DOM Interface HTML Heading Element
Animatable no

H1 Heading

h1 is the first level heading

Try It Now Watch GIF

H2 Heading

h2 is the second level heading

Watch GIF Try It Now

H3 Heading

h3 is the third level heading

Watch GIF Try It Now

H4 Heading

h4 is the fourth level heading

Watch GIF Try It Now

H5 Heading

h5 is the fifth level heading

Watch GIF Try It Now

H6 Heading

h6 is the sixth level heading

Watch GIF Try It Now

The align attribute is deprecated in HTML 4.01 and in HTML5.

All HTML Headings

The following code shows all the heading levels, in use.

Watch GIF Try It Now

Important Note: The heading elements' number(h1, h2, h3, h4, h5, h6) defines their rank for their importance on the page.

Browser Support
Headings (Yes) (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)

Practice with Our Interactive Live Code Editor and Take your HTML Skills to the next level

Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Exercise 6 Exercise 7

Sources and Credits

The source of the content has been referred and updated with Mozilla Foundation and w3C