Lesson 2 of 21 – HTML Headings
10%
10%

HTML Headings

HTML headings are titles or subtitles that you want to display on a webpage. They help users understand the structure of a page and make the content easy to read.

HTML headings are defined with: <h1> to <h6>

What are HTML Headings?

HTML headings are used to define the titles and section headings of a webpage. The heading tags range from <h1> to <h6>. <h1> is the largest and most important heading, while <h6> is the smallest and least important.

Heading Levels

<h1> defines the most important heading.
<h6> defines the least important heading.

Why Are Headings Used?

Headings are used for structure, readability, and design. They help people and search engines understand the topic of each section.

Uses of HTML Headings
  • Structure and Hierarchy: Headings organize content in a clear order.
  • Styling and Design: Headings are usually bigger and bold, so they stand out.
  • User Experience: Headings make pages easier to scan and read.

Why Headings Are Important

Search engines use headings to understand the content of a webpage. Users also skim pages by reading headings first. That is why headings should be used properly and in order.

💡 Remember
Use <h1> for the main title of the page, then use <h2>, <h3>, and so on for subheadings.

Uses of h1 to h6

Each heading level shows different importance in the document hierarchy.

Tag Use
<h1> Main title of the page
<h2> Major section heading
<h3> Subsection heading
<h4> Smaller subsection heading
<h5> Lower level heading
<h6> Smallest heading

Example of Headings

Example Code
<h1>This is the main heading</h1>
<h2>This is a subheading</h2>
<h3>This is a smaller heading</h3>

Key Points

  • Headings are important for SEO and accessibility.
  • They help structure the content of a webpage.
  • <h1> should be used only once per page.
  • <h2> to <h6> can be used multiple times as needed.

Reason to Use Headings

Headings provide a clear visual beginning of each section or topic. They improve readability, help users find information quickly, and make the webpage look organized.

💡 Remember
Proper headings make your webpage easy to read, easy to navigate, and better for search engines.

🧠 Quiz

Which heading tag is the most important?