Headings

HTML provides six levels of headings, from <h1> to <h6>.
Headings are used to define titles or subtitles that organize the content on a webpage.
<h1> represents the most important heading, and <h6> represents the least important.

Basic Syntax

  <h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Section Title</h3>
<h4>Subsection</h4>
<h5>Minor Heading</h5>
<h6>Smallest Heading</h6>

Heading Size Comparison

This is <h1> Heading

This is <h2> Heading

This is <h3> Heading

This is <h4> Heading

This is <h5> Heading
This is <h6> Heading

Usage Tips

  • Use <h1> for the main title of the page (only once).
  • Use <h2> to <h6> to organize subtopics and content sections.
  • Headings help search engines understand your content better (SEO).
  • You can style headings using CSS for color, size, font, etc.
Output :