Headings in HTML are similar to headings in other types of media. For example, in newspapers, large headings are typically used to capture a reader’s attention. Other times, headings are used to describe content, like the title of a movie or an educational article.

HTML follows a similar pattern. In HTML, there are six different headings, or heading elements. Headings can be used for a variety of purposes, like titling sections, articles, or other forms of content.

The following is the list of heading elements available in HTML. They are ordered from largest to smallest in size.

  1. <h1> — used for main headings. All other smaller headings are used for subheadings.
  2. <h2>
  3. <h3>
  4. <h4>
  5. <h5>
  6. <h6>

The following example code uses a headline intended to capture a reader’s attention. It uses the largest heading available, the main heading element:




Now that you know how to structure HTML elements, we’ll spend the rest of the lesson building an informational website using some of the most common HTML elements. We’ve put some elements in to get you started, but you’ll write the rest of the page on your own.

Below the <h3> heading that says Features, add an <h2> heading that says Habitat.


Below the Habitat heading, add an <h3> heading that says Countries with Large Brown Bear Populations.


On the next line, add one more <h3> heading that says Countries with Small Brown Bear Populations.


Finally, on the next line add an <h2> heading that says Media.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?