HTML <h2> Tag
<h2>Heading Level 2</h2>
The above example demonstrates usage of the <h2>
element.
The <h2>
element represents a level 2 heading for its section.
There are 6 levels of heading — 1 to 6. The levels represent the heading's rank. 1 is the highest rank, 6 is the lowest rank. Two headings of the same level are the same rank.
The 6 Levels of Headings
The six levels of headings in HTML are:
A heading's level is only relevant to its section. For example, you could have many <section>
elements within a page, each with a <h2>
element. Each section's <h2>
element is a level 2 heading for that section. Furthermore, the document's <body>
element could have its own <h2>
element, which would be applicable to the document's body (which also consists of the various <section>
elements).