HTML headings are defined with the <h1>
to <h6>
tags. These tags represent different levels of headings in a document, with <h1>
being the highest level and <h6>
the lowest. Headings are important for SEO and accessibility, providing structure and hierarchy to the content.
Here is an example demonstrating how to use various heading tags:
<h1>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>
<h4>This is a Heading 4</h4>
<h5>This is a Heading 5</h5>
<h6>This is a Heading 6</h6>
In this example, headings are used to structure a document into sections and subsections:
<h1>Main Heading</h1>
<h2>Subheading 1</h2>
<h3>Sub-subheading 1</h3>
<h2>Subheading 2</h2>
<h3>Sub-subheading 2</h3>