Web development · Lesson 02
Give your content structure
Use HTML elements that explain what each part of a page means.
- 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.
<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>Which element should you use for an action that changes something on the page?
Your turn
Write a simple outline for a page about a hobby: one main heading, two section headings, and one link.
<main><h1>My hobby</h1><section><h2>How I started</h2></section><section><h2>What I enjoy</h2><a href="/projects">View my project</a></section></main>
BUILT TOGETHER
Help make this explanation better.
Have a clearer explanation, a useful example, or a correction? Share it with the community.
Be the first to add your name when you improve this lesson.
How to get credited