Skip to main content

HTML Headings

By SamK
0
0 recommends
Topic(s)

HTML heading tags are used to display headings, titles and subtitles in web pages.

Headings are defined by <h1>, <h2>, <h3>, <h4>, <h5> and <h6> tags. The most important heading is defined by the <h1> tag and the least important heading is defined by the <h6> tag.

Examples:

Heading 1

<h1>Heading 1</h1>

Heading 2

<h2>Heading 2</h2>

Heading 3

<h3>Heading 3</h3>

Heading 4

<h4>Heading 4</h4>
Heading 5
<h5>Heading 5</h5>
Heading 6
<h6>Heading 6</h6>

Headings are block elements and browsers automatically add some margin before and after a heading. Headings are important for SEO and they define the structure of the web page.

It is recommended to use only one <h1> tag in an HTML document, i.e. for the main page title only.

Use heading tags only for headings, not for just making any text larger or bolder. HTML headings have a default style and size but you can also specify font size and styles for the headings, for example:

<h2 style="font-size:30px; color:red">Heading 2</h2>

Please check below options for the links to our previous or next tutorial.

Questions & Answers