Heading Tags in HTML – HTML Tutorial

This post “HTML Heading Tags” provides clear explanation of how to use Heading tags in HTML documentation and what are the most important and least important heading tags to be used in HTML document.


 

Headings:

  • Headings can be displayed on a web page using pre-defined heading elements like h1,h2….h6.
  • These are non empty elements.
    <h1> : Most important heading.
    <h6> : Least important heading.
  • The purpose to heading not to highlight the information on web page.
  • Search engines use headings to index the structure and content of your web pages.

<!DOCTYPE html>
<html>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>

 

HTML Horizontal lines : The <hr> tag creates a horizontal line in an HTML page.

<!DOCTYPE html>
<html>
<body>
<p>The hr tag defines a horizontal line :</p>
<hr>
<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>
</body>
</html>

 

Text Formatting in HTML

Share this