Summary -
In this topic, we described about the h1-h6 tags along with detailed example.
Used to define HTML headings. Any HTML normally starts with Heading. There are six different sizes headers available in HTML. The six headers in html use the tags <h1> to <h6>.
<h1> tag called as level1(top) heading. Similarly <h6> is level6(lowest) heading. If any of the above header tag used, while displaying the browser will add one line before and after the header. Any two heading with same name are at equal in rank.
Ending tag is mandatory for each header from <h1> to <h6>. The tag can be specified like <h1></h1> with the heading text between the opening and closing tags.
Syntax -
<h1>.. text here.. </h1>
<h2>.. text here.. </h2>
<h3>.. text here.. </h3>
<h4>.. text here.. </h4>
<h5>.. text here.. </h5>
<h6>.. text here.. </h6>
Example -
<!DOCTYPE html>
<html>
<head>
<title>Heading tag example..</title>
</head>
<body>
<h1>Displaying Header 1</h1>
<h2>Displaying Header 2</h2>
<h3>Displaying Header 3</h3>
<h4>Displaying Header 4</h4>
<h5>Displaying Header 5</h5>
<h6>Displaying Header 6</h6>
</body>
</html>