Headings (<h1>to <h6>)

Headings are used in HTML to define titles and subtitles of a web page. They help structure content and make it easier for users and search engines to understand the page.

What are Headings

HTML provides six levels of headings from h1 to h6. Each level represents different importance, with h1 being the most important and h6 being the least important.

Headings are very important for readability and SEO because they organize content in a proper hierarchy.

h1 Heading

The h1 tag is used for the main heading of a page. It should represent the main topic of the page and is usually used only once per page.

h2 Heading

The h2 tag is used for main sections of the page. It helps divide content into major parts under the h1 heading.

h3 to h6 Headings

The h3, h4, h5, and h6 tags are used for sub-sections. They break content into smaller parts and create a clear structure inside each section.

As the number increases, the importance of the heading decreases.

Example

<h1>Main Title</h1> <h2>Section Title</h2> <h3>Subsection Title</h3> <h4>Smaller Detail</h4> <h5>Minor Point</h5> <h6>Least Important Heading</h6>

Best Practices

Use only one h1 per page for the main title.
Use headings in proper order to maintain structure.
Do not skip levels randomly, such as jumping from h1 to h4.
Use headings to organize content, not just for styling.

Summary

Headings from h1 to h6 create a clear structure for web pages. They improve readability, accessibility, and SEO by organizing content in a logical order.

Home » HTML Fundamentals (Beginner) > Text & Formatting > Headings ( to )