Lesson 50 of 50
cssCapstone Project – Build a Complete Responsive Site
30 mins
Course progress100%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 50 of 50
css30 mins
Keep these ideas in mind as you work through the lesson.
Create a real‑world three‑page website that showcases every major technique you’ve learned:
srcset, sizes, loading="lazy".preload, contain, and image optimisation.my-site/
├─ index.html (Home)
├─ blog.html (Blog listing)
├─ post.html (Single article)
├─ css/
│ ├─ base.css (reset, typography)
│ ├─ layout.css (grid, utilities)
│ ├─ components.css (buttons, cards, nav)
│ └─ theme.css (variables, dark‑mode)
├─ img/ (optimized JPEG/AVIF/WebP)
├─ js/
│ └─ theme-toggle.js (dark‑mode toggle)
└─ tests/ (Backstop config, stylelint)
| Feature | Implementation Detail |
|---|---|
| Header | <header> with logo, nav (grid + flex). Sticky on scroll (position:sticky). |
| Hero | Full‑height section (height:100vh) with background image, gradient overlay, centered call‑to‑action (Flex). |
| Content Grid | Blog cards using grid-template-columns: repeat(auto-fill, minmax(260px,1fr)). Each card uses Flex for image + text alignment. |
| Responsive Images | <picture> with source type="image/avif", fallback srcset for WebP & JPEG. loading="lazy". |
| Dark Mode | CSS variables defined on :root; @media (prefers-color-scheme:dark) fallback; manual toggle via data-theme attribute. |
| Accessibility | <nav aria-label="Main navigation">; button with :focus-visible; skip‑link at top; role="region" for each major section; all colour pairs meet AA contrast. |
| Performance | Inline critical CSS (hero styles, font‑face); <link rel="preload" href="/css/layout.css" as="style" onload="this.rel='stylesheet'">; contain on heavy sections (.gallery { contain:layout style; }). |
| SEO | <meta name="description">; Open Graph (og:title, og:image); JSON‑LD schema for Article. |
| Testing | Run npm run lint:css, npm run backstop:test, npm run lighthouse. Document results in README.md. |
cwebp/avif and include <source> elements for modern browsers.font-display:swap on web‑fonts to avoid FOIT.position:fixed; bottom:2rem; right:2rem;).@supports not (display:grid) { … }).| Category | What the reviewer looks for |
|---|---|
| Correctness | All listed features are present and work across major browsers. |
| Code Quality | Clean, organized CSS (SCSS optional), BEM/ITCSS naming, no unused selectors. |
| Accessibility | Full keyboard navigation, focus rings, colour contrast, ARIA landmarks. |
| Performance | Critical CSS inline, lazy‑loaded images, < 2 s First Contentful Paint on Lighthouse. |
| Responsiveness | Layout gracefully adapts from 320 px to 1920 px without horizontal scroll. |
| Testing | Lint passes, visual regression diff is clean, Lighthouse score ≥ 90. |
By the end of this capstone you will have a production‑ready codebase that demonstrates modern CSS mastery – exactly what recruiters and clients look for.