HTML Headings

Use HTML Heading tags

<h1> to <h6> tags mark the headings for HTML document. <h1> marks the largest headings size and <h6> creates smallest headings.

H1 headings should be used as main headings.


<!DOCTYPE HTML>
<html> 
<body> 
    <h1>Heading 1</h1> 
    <h2>Heading 2</h2> 
    <h3>Heading 3</h3> 
    <h4>Heading 3</h4> 
    <h5>Heading 3</h5> 
    <h6>Heading 3</h6> 
</body> <!--  w  ww  . j  ava  2s  .c  o m-->
</html> 

Click to view the demo

<h1> to <h6> should be used as HTML headings only. Don't use headings to make text big or bold.

Browsers automatically add an empty line before and after headings.

The code above generates the following result.

HTML Headings