Headings in HTML


Notations:
  • Headings in HTML are important because search engine gives prefferences to headings.
  • World Wide Web Consotorium(W3C) suggests not to use headings for making texts big or bold.Headings are used only to give idea about content of HTML documents.
  • Search engines give first prefference to <h1> headings then <h2> headings and so on.

Types of headings in HTML

There are six type of headings in HTML.They range from <h1> to <h6>.

Example:

<html>
<body>
<h1>This is heading.</h1>
<h2>This is heading.</h2>
<h3>This is heading.</h3>
<h4>This is heading.</h4>
<h5>This is heading.</h5>
<h6>This is heading.</h6>
</body>
</html>

Output:

This is heading.

This is heading.

This is heading.

This is heading.

This is heading.
This is heading.

Head elements are different from Headings

Head elements contains meta element.Meta elements are not displayed in outputs they are used by search engines to identify HTML contents.You will studying about use of meta data latter.

Example:

<!DCOTYPE html>
<html>
<head>
<meta chartset="UTF-8">
<title>
Details on heading. </title>
</head>
<body>
<h1>This is heading.</h1>
</body>
</html>

Output:

This is heading.