HTML headings are titles or subtitles of a webpage. They are defined with the <h1>
to <h6>
tags. <h1>
is the most important heading. <h6>
is the least important heading.
1<h1>h1 heading</h1>
2<h2>h2 heading</h2>
3<h3>h3 heading</h3>
4<h4>h4 heading</h4>
5<h5>h5 heading</h5>
6<h6>h6 heading</h6>
7
8/* it can be custimized with style attribute */
9<h1 style="font-size:60px;">custom h1 heading</h1>
Sample Output
h1 heading
h2 heading
h3 heading
h4 heading
h5 heading
h6 heading
custom h1 heading
TIP
Why Headings Are Important
- Search engines use the headings to index the structure and content of your web pages. Examine headings for appropriate keywords in a user’s search. If your headings match what people are searching for, generally, your content has a better chance of surfacing early in Google search results.
- HTML headings provide valuable information by highlighting important topics and the structure of the document and enhance Readability And Visibility