Headings


Headings

There are 6 levels of headings in HTML. H1, H2, H3, H4, H5, H6 are the 6 levels where H6 is the highest and H1 is the lowest. These tags are used for writing the title and the subtitles on the web pages. The information in between these tags is printed in bold and the size depends on the numbering. The search engine takes the help of the headings to understand and index the structure of web pages.

A title or a subtitle that you want to display on the webpage can be defined as an HTML heading or HTML h tag.

  • Search engines use headings to index the structure and content of a webpage.
  • Essential subjects are highlighted with headings.
  • They provide helpful information and inform us about the document's structure.

HTML Headings Can Be Changed in Size:

The style attribute can be used to adjust the default size of HTML headers.

HTML's horizontal rule is:

In an HTML page, the "hr" tag, which stands for the horizontal rule, is used to establish a theme break. It's primarily used to divide content.

HTML's head element:

The HTML head element serves as a metadata container. Metadata is information about an HTML document that isn't visible. Headings have nothing to do with the head element. Instead, between the "HTML" tag and the "body" tag is the head element.

Example No.1:

<html> <body> <h1>Knowledge2life 1</h1> <h2>Knowledge2life 2</h2> <h3>Knowledge2life 3</h3> <h4>Knowledge2life 4</h4> <h5>Knowledge2life 5</h5> <h6>Knowledge2life 6</h6> </body> </html>

OUTPUT

Knowledge2life 1

Knowledge2life 2

Knowledge2life 3

Knowledge2life 4

Knowledge2life 5
Knowledge2life 6

Example No.2:

<html> <body> <h6>Knowledge2life 1</h6> <h5>Knowledge2life 2</h5> <h4>Knowledge2life 3</h4> <h3>Knowledge2life 4</h3> <h2>Knowledge2life 5</h2> <h1>Knowledge2life 6</h1> </body> </html>

OUTPUT

Knowledge2life 1
Knowledge2life 2

Knowledge2life 3

Knowledge2life 4

Knowledge2life 5

Knowledge2life 6