Learning Resources
 

hn Tag for Headings


Page headings are created with the n> tag, in which n is a number between 1 and 5. For example:

Heading

Unless otherwise specified, headings are displayed using a larger size of the default font. There are five levels of heading, each using a slightly smaller font size. The range of headings usually look something like this:

HTML:      Displayed As:

Heading 1

  Heading 1

Heading 2

  Heading 2

Heading 3

  Heading 3

Heading 4

  Heading 4
Heading 5
  Heading 5

Using these variations, we can create a page with headings and sub-headings like so:

HTML:      Displayed As:

Main Heading


 

Main Heading

First paragraph content.

  First Paragraph content.

Sub Heading

  Sub Heading

Second paragraph content.

  Second paragraph content.
etc...    

Heading tags can have many of the same attributes as paragraph tags, for example:

Main Heading