HTML Tags Web development basics

HTML headings

HTML headings are important in HTML documents. HTML defines six levels of headings. A heading element implies all the font changes, paragraph breaks before and after, and any white space necessary to render the heading.

The heading elements are <h1> , <h2> , <h3> , <h4> , <h5> and <h6> with <h1> being the highest (or most important) level and <h6> the least.

Example:

Result:


I am heading h1

I am heading h2

I am heading h3

I am heading h4

I am heading h5
I am heading h6

Key points about HTML headings:

  • HTML headings outline structure of your web page.
  • Headings are important as search engines use headings to index the content of a webpage.
  • A web page should have only one main heading i-e the <h1> tag.
  • <h1> headings should be used for main headings, followed by <h4> headings, then the less important <h3>, and so on.
  • The default value of most browser of <h1> – <h6> tags is:

Horizontal Rule:

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.The <hr> element is used to separate content (or define a change) in an HTML page.

Example:


Result:

I am a heading h1

Text…


I am a heading h2

text…


Browser support for headings

HTML headings