HTML Elements

Headings

Titles are important everywhere; particularly on web pages. They structure documents and help users get a sense of the web page's organization and structure.

We can create headings using the <h1>, <h2>, <h3>, <h4>, <h5> and <h6> tags, where <h1> is the most important heading and <h6> the least important.

Code example

<h1>My main title</h1>
<h2>Subtitle</h2>

Accessibility

Headings on web pages should to be larger and easier to spot than the rest of the body text. We should make an effort in making headings visually distinct to help users with disabilities.

H1

Only use one <h1> per page - this should represent the main heading/subject for the whole page. Also, do not skip heading levels - start with <h1>, then use <h2>, and so on.

Read more on MDN

<h1>–<h6>: The HTML Section Heading elements

Test yourself

Description

Add an <h2> tag that says

Mischief Managed

to create a second HTML element below your Marauder's Map <h1> element.

Tests

  1. 1 You should create an h2 element.
  2. 2 Your h2 element should have a closing tag.
  3. 3 Your h2 element should have the text "Mischief Managed".
  4. 4 Your h1 element should have the text "Marauder's Map".
Editor
Preview