HTML Headings <h1>

Usage

There are 6 HTML heading tags:

<h1>
<h2>
<h3>
<h4>
<h5>
<h6>

<h1> is to only be used once, as the title of the page.

WordPress for example automatically makes the page title the <h1> so in the case of this page the <h1> is ‘HTML Heading <h1>’.

Use the heading tags to help outline the structure of your page with <h1> being the most important heading, the title, and <h6> being the least important.

You can use headings as many times as you want, however you should never skip a heading, i.e. going from <h2> to <h4>.

Note that headings will force a line break when used.

Google has confirmed that they look at heading tags in an effort to understand the structure of your page, so the proper use of headings is important.

Code:


<!DOCTYPE html>
<html>
<head>
<!-- This is the stylesheet John created in 2020 -->
<link rel="stylesheet" href="/file/stylesheet.css">
</head>

<body>

<p>Welcome to my webpage and paragraph 1.</p>

<h2>Things we'll discuss</h2>

<p>We'll be discussing the elements that go into building a webpage.</p>

<h3>HTML</h3>
<p>Some text here.</p>

<h3>CSS</h3>
<p>Some text here.</p>

</body>

</html>

Output:

Welcome to my webpage and paragraph 1.

Things we’ll discuss

We’ll be discussing the elements that go into building a webpage.

HTML

Some text here.

CSS

Some text here.