HTML Headings

HTML Headings are used to define titles and headings on a web page. HTML provides six heading levels, from <h1> to <h6>. Proper use of headings improves readability, accessibility, and search engine optimization (SEO).

What are HTML Headings?

HTML Headings are used to organize and structure the content of a web page. The <h1> tag represents the most important heading, while <h6> represents the least important heading.

HTML Headings help users and search engines understand the structure of a webpage.

Basic HTML Headings Example

The following example shows all six HTML heading levels.

<!DOCTYPE html>
<html>
<body>

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

</body>
</html>

Try HTML Headings

HTML Heading Levels

HTML provides six heading levels. Each level represents the importance of the heading.

  • <h1> - Main page heading
  • <h2> - Major section heading
  • <h3> - Subsection heading
  • <h4> - Smaller subsection
  • <h5> - Minor heading
  • <h6> - Smallest heading

Heading Hierarchy

Headings should be used in order to create a clear structure for your webpage.

Website

H1  Learn HTML

├── H2  HTML Basics
│   ├── H3  HTML Elements
│   └── H3  HTML Attributes
│
├── H2  HTML Forms
│
└── H2  HTML Tables

Best Practices for HTML Headings

  • Use only one <h1> for the main page title.
  • Use headings in the correct order whenever possible.
  • Do not use headings only to make text larger.
  • Write clear and meaningful headings.
  • Use headings to organize page content.

Why Learn HTML Headings?

HTML Headings are important because they organize content, improve accessibility, and help search engines understand your webpage.

  • Improve website structure
  • Make pages easier to read
  • Help with SEO
  • Improve accessibility
  • Create professional web pages

Frequently Asked Questions

What are HTML Headings?

HTML Headings are heading tags ranging from <h1> to <h6> that organize and structure content on a webpage.

How many heading levels are available in HTML?

HTML provides six heading levels: <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.

Should a webpage have only one H1 heading?

Yes. In most cases, a webpage should have one <h1> that represents the main topic of the page. Additional sections should use <h2> to <h6> as needed.