Lesson 23 of 23
In progress
Capstone: a responsive landing page
Combine semantic HTML, Flexbox, Grid, tokens and media queries into one accessible landing page you can actually ship.
This is the last lesson in the track. You will build one page with a header, hero, feature cards, a call to action and a footer, using only what you have learned, and check it the way a reviewer would.
What you will learn
- Assemble a page from landmarks, sections and one clear heading hierarchy.
- Reuse tokens, Grid and Flexbox instead of inventing new values per section.
- Review the result with keyboard, zoom, contrast and a narrow viewport.
What you will build
A single-page site for a fictional course, with:
- A landmark header with a skip link and a navigation list.
- A hero with one
h1, a short paragraph and two actions. - Three feature cards in a Grid that reflows without media queries.
- A call-to-action band with a contrast-checked button.
- A footer with links and a copyright line.
- Tokens for colour, spacing and radius, plus a dark-mode token set.
Structure before styling
Editable. Runs in your browser.
<header class="site-header">
<a class="brand" href="/">Tutorials.in</a>
<nav aria-label="Main">
<ul class="nav-list">
<li><a href="#features">Features</a></li>
<li><a href="#start">Get started</a></li>
</ul>
</nav>
</header>
<main id="main">
<section class="hero">
<h1>Learn the web by building it</h1>
<p>Short lessons, real projects, no build tools.</p>
<a class="button" href="#start">Start the course</a>
</section>
<section class="features" id="features" aria-labelledby="features-title">
<h2 id="features-title">What you get</h2>
<div class="cards">
<article class="card"><h3>24 lessons</h3><p>From first tag to full page.</p></article>
<article class="card"><h3>No setup</h3><p>A browser is enough.</p></article>
<article class="card"><h3>Accessible</h3><p>Built the right way from the start.</p></article>
</div>
</section>
<section class="cta" id="start">
<h2>Ready to start?</h2>
<p>Begin with how the web works.</p>
<a class="button button–light" href="/tutorials/html-css/">Open lesson one</a>
</section>
</main>
<footer class="site-footer">
<p>© 2026 Tutorials.in</p>
<nav aria-label="Footer">
<a href="/privacy/">Privacy</a>
<a href="/contact/">Contact</a>
</nav>
</footer>
Press Run to see the output.
Notice the decisions: one h1, headings nested h2 then h3, an aria-labelledby naming the features section, and two labelled nav elements. Those are not extras; they are the structure the styling hangs on.
The styles
Editable. Runs in your browser.
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.6;
background: var(–bg); color: var(–ink); }
h1, h2, h3 { line-height: 1.15; margin-block: 0 0.5em; }
a { color: var(–brand); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(–surface); padding: 0.5rem 1rem; z-index: 10; }
.site-header { display: flex; flex-wrap: wrap; gap: var(–space-4);
justify-content: space-between; align-items: center;
padding: var(–space-4) clamp(1rem, 4vw, 2rem); background: var(–surface); }
.brand { font-weight: 700; text-decoration: none; }
.nav-list { display: flex; gap: var(–space-4); list-style: none; margin: 0; padding: 0; }
.hero { padding: clamp(2rem, 8vw, 5rem) clamp(1rem, 4vw, 2rem);
max-width: 46rem; }
.hero h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3.25rem); }
.hero p { color: var(–soft); font-size: 1.125rem; max-width: 60ch; }
.button { display: inline-block; padding: 0.75rem 1.25rem; border-radius: 999px;
background: var(–brand); color: #ffffff; text-decoration: none; font-weight: 600; }
.button:hover { background: #47268a; }
.button:focus-visible { outline: 3px solid #16162c; outline-offset: 3px; }
.features { padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem); }
.cards { display: grid; gap: var(–space-4);
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(–surface); border: 1px solid var(–border);
border-radius: var(–radius); padding: var(–space-8); }
.cta { background: #3b2478; color: #ffffff; padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem); }
.cta p { color: #e6defa; }
.button–light { background: #ffffff; color: #3b2478; }
.site-footer { display: flex; flex-wrap: wrap; gap: var(–space-4);
justify-content: space-between; padding: var(–space-8) clamp(1rem, 4vw, 2rem); }
.site-footer nav { display: flex; gap: var(–space-4); }
@media (prefers-color-scheme: dark) {
:root { –bg: #12132a; –surface: #1b1d38; –ink: #ececf7;
–soft: #a9abcb; –brand: #c4adfa; –border: #2c2e4d; }
.button { color: #12132a; }
.button:hover { background: #a98bf0; }
.button:focus-visible { outline-color: #ececf7; }
}
</style>
Press Run to see the output.
Everything here has appeared earlier in the track: tokens, a container with fluid padding, Flexbox for the header, Grid with auto-fit for the cards, clamp() for type and space, and a dark token override.
Review it like a stranger
Before calling it done, run the checklist on a fresh browser profile where nothing is cached, because a warm cache hides first-load problems. Then repeat it once with the window narrow and once at 200 percent zoom; the order of failures will tell you which rule is doing too much.
- Keyboard: Tab from the top. The skip link appears first, every link gets a visible ring, nothing traps focus.
- Zoom: at 200 percent, the cards stack and no text is clipped.
- Contrast: body text, the button label and the CTA paragraph all clear 4.5:1. The light button on the dark band is the pair most likely to fail.
- Headings: one
h1, thenh2for sections andh3for cards. No skipped levels. - Images: if you add any, every one has alt text and explicit dimensions.
- Widths: no horizontal scrollbar at 320 pixels.
Two details worth fixing in most first attempts: the dark-mode button text colour, because a light brand colour behind white text fails, and the CTA paragraph, because white at low opacity on purple is a common contrast miss.
Extending it
Add a testimonial section with a blockquote and cite, a pricing table using the table semantics from lesson 6, or a small form using the labelled inputs from lesson 8. Each addition should reuse the tokens rather than introduce new colours.
The JavaScript track continues from this page: a mobile menu toggle, a theme switch and form validation without a page reload.
Building the page section by section without ever resizing it produces a layout that only works at the width you designed on. Resize after each section, not at the end, when the fix is cheaper and the cause is obvious.
Add a fourth card and a testimonial section to the page. Keep the Grid reflowing, make the quote readable at 65 characters, and ensure the new section uses existing tokens.
Show solution
Editable. Runs in your browser.
<style>
.quote { max-width: 65ch; margin: 0; padding: 2rem; background: #ffffff;
border-inline-start: 4px solid #5b33a6; border-radius: 0 12px 12px 0; }
.quote footer { margin-block-start: 1rem; color: #4b4d6b; }
</style>
Press Run to see the output.
The quote is capped at a readable measure, the border gives it emphasis without an icon, and the colours match the existing tokens rather than introducing a new palette.
Recap
- Build structure first: landmarks, one
h1, labelled sections, then style. - Reuse tokens, Grid
auto-fit, Flexbox and fluidclamp()spacing rather than new values. - Review with keyboard, zoom, contrast and a narrow viewport before calling it done.
You have finished HTML and CSS. Next, the JavaScript track adds behaviour to pages like this one.
How long should a landing page be?
Should I use a framework now?
Progress is saved in this browser only. No account, no email.