Headings are very useful in HTML documents. The main use of headings to create different size of page headings according to their importance.
- You can defined headings, by use the <h1> to <h6> HTML tags.
- <h1> defines the most important heading. <h6> defines the least important heading.
HTML Heading Example
<h1>This is a heading One</h1> <h2>This is a heading Two</h2> <h3>This is a heading Three</h3> <h4>This is a heading Four</h4> <h5>This is a heading Five</h5> <h6>This is a heading Six</h6>
By default heading has a margin, before and after each heading tag.
Importance of Heading
- HTML headings are only used to create headings.
- Heading tags are used by search engines to identify words which are more important than the rest of the page text. The theory is that headings will sum up the topic of the page, so they are counted as important keywords.
- <h1> headings should be used as main headings, followed by <h2> headings, then the less important <h3> headings, and so on.