Course contentsLesson 2 of 6← Course overview
  1. 01A page is a conversation18 min
  2. 02Give your content structure24 min
  3. 03Make a layout that adapts32 min
  4. 04Make a button do something35 min
  5. 05Make forms easier to use28 min
  6. 06Keep a trail of your work36 min

Web development · Lesson 02

Give your content structure

Edit lesson

Use HTML elements that explain what each part of a page means.

24 minProgress saves on this device
In this lesson
  • Use headings in a meaningful order
  • Choose elements by purpose rather than appearance

Helpful background: Complete “A page is a conversation” or know what HTML is for.

Meaning before appearance

A heading is not just large text. It tells people and software what a section is about. A button means an action can happen. A link takes you somewhere. Choosing the right element makes a page easier to navigate and maintain.

Build a clear outline

Start with one main heading for the page. Use subheadings for sections beneath it. Heading levels describe the outline; CSS can make them look however your design needs.

Small markup, clear intent

Prefer a real button for an action and an anchor for navigation. Use labels for form fields. These choices improve keyboard use and give assistive technology better information.

A semantic page outlinehtml
<main>
  <h1>My learning journal</h1>
  <section aria-labelledby="week-one">
    <h2 id="week-one">Week one</h2>
    <p>Today I built my first page.</p>
    <a href="/projects">See the project brief</a>
  </section>
</main>
Knowledge check

Which element should you use for an action that changes something on the page?

Try first; feedback appears after you check.
Apply it

Your turn

Write a simple outline for a page about a hobby: one main heading, two section headings, and one link.

Continue readingMDN: HTML basics

BUILT TOGETHER

Help make this explanation better.

Have a clearer explanation, a useful example, or a correction? Share it with the community.

Contributors

Be the first to add your name when you improve this lesson.

How to get credited
Previous lessonNext lesson