HTML Headings

❮ Previous Home Next ❯


<h1>Heading One</h1>
<h2>Heading Two</h2>
<h3>Heading Three</h3>
<h4>Heading Four</h4>
<h5>Heading Five</h5>
<h6>Heading Six</h6>

The <h1> to <h6> HTML elements represent six levels of headings. <h1> is the highest level and <h6> is the lowest.


Bad Practice

<h1>Heading level 1</h1>
<h3>Heading level 3</h3>
<h4>Heading level 4</h4>

Good Practice

<h1>Heading level 1</h1>
<h2>Heading level 2</h2>
<h3>Heading level 3</h3>

You can use different sizes for your headings. HTML also has six levels of headings, which use the elements <h1>, <h2>, <h3>, <h4>, <h5>, <h6>.

While displaying any heading, browser adds one line before and one line after that heading.

Styling Headings

You can use CSS for styling.


<h1 style="color: tomato">Heading One</h1>
<h2 style="background: tomato">Heading Two</h2>
<h3 style="font-family:monaco">Heading Three</h3>

A complete list of all HTML tags, see HTML Tag Reference.

❮ Previous Home Next ❯