Lesson 12 of 29 · Page Structure & Forms
Boss: Build an Accessible HTML Sign-Up Form
The Form Gatekeeper blocks the way. Every test you pass deals damage — pass them all to defeat it and claim a loot chest.
The gate to the Guild of Web Crafters is guarded by the Form Gatekeeper, an iron sentinel that only admits travellers who hand in a proper application. It can't see sloppy markup: every field needs a label, and every part of the page needs its proper place. Build the guild's sign-up page, and the gate swings open.
Battle plan
This fight uses everything from Chapter 2:
- semantic regions —
<header>,<main>,<section>and<footer>— instead of anonymous boxes - a
<label>for every field, connected withforand the field'sid - the right field for each answer: text, email and number inputs, a
<select>menu, a<textarea>and a checkbox required,placeholderandminto help visitors fill the form in correctly
Wrap each label and its field in a <p>, so every field gets its own line:
<p>
<label for="hero">Hero name</label>
<input type="text" id="hero" name="hero" required>
</p>
Assignment
Build the page inside <body>:
- A
<header>with the<h1>Guild of Web Crafters. - A
<main>with a<section>. The section starts with the<h2>Sign up, followed by a<form>with these six fields. Every field has a<label>whoseformatches the field'sid, and anameequal to itsid:
| Label | Field | id and name |
Extra |
|---|---|---|---|
Hero name |
text input | hero |
required |
Email |
email input | email |
required, placeholder [email protected] |
Age |
number input | age |
min="12" |
Class |
<select> with the options Mage, Knight, Ranger |
class |
|
About you |
<textarea> |
bio |
|
I accept the guild rules |
checkbox, with the label after the box | rules |
required |
- At the end of the form, a submit button with the text
Send application. - After
<main>, a<footer>with the paragraphMembers only. No dragons allowed.
Every passing test dents the Gatekeeper's armour. Make all ten pass and walk right through.
Premium lesson
Unlock the full Learn HTML & CSS course
- All 29 lessons, bosses and quizzes — lifetime access
- One payment of $35, no subscription
- Finish within 30 days and claim $10.50 (30%) back
Want more than one course?
The All-Access Pass unlocks all 8 courses and every new one we release, for $120 once.
Keep learning
Need a quick reminder? The HTML & CSS cheat sheet has every topic of Learn HTML & CSS on one page.
Lesson last updated on .