Lesson 29 of 29 · Polish & Interaction
Boss: Build a Responsive Landing Page with HTML & CSS
The Grand Gallery Guardian blocks the way. Every test you pass deals damage — pass them all to defeat it and claim a loot chest.
At the very top of the Painted Cliffs stands the Grand Gallery, the finest page in the realm, and its doors are watched by the Grand Gallery Guardian. It lets only one kind of visitor in: a builder who can raise a complete, polished web page from bare HTML. Everything you've learned in this course leads to this door.
Battle plan
This final fight combines the whole course:
- CSS variables on
:rootkeep the colours and the corner radius in one place. - Flexbox lays out the header: the logo at one end, the navigation at the other.
position: stickykeeps the header in view while the page scrolls.- CSS Grid arranges the exhibit cards, and a media query stacks them on phones.
max-widthandmargin: 0 autocentre the content on wide screens.:hover,transitionandtransformmake the cards lift smoothly.
Once the variables exist, every colour on the page can come from them:
.site-footer {
background: var(--dark);
}
Assignment
Build the Grand Gallery landing page. Define the variables where the first comment says, change the hard-coded values in the existing rules, and write everything else below the second comment:
- Variables: in a
:rootrule, define--accent: #f5b301,--dark: #2b2620and--radius: 16px. Use them instead of the hard-coded values: the.site-headerand.site-footerbackgrounds becomevar(--dark), the.btnbackground becomesvar(--accent), and the.feature-cardcorners becomevar(--radius). - Header: make
.site-headera flex container with the logo at the left end and the navigation at the right end, vertically centred. Make it sticky at the top (position: sticky,top: 0) withz-index: 10. - Navigation: make
.site-nava flex container with a24pxgap. Hovered links (.site-nav a:hover) get the colourvar(--accent). - Content: give
.containeramax-widthof960pxand centre it withmargin: 0 auto. - Centred text: centre the text of
.heroand of.site-footer(text-align: center). - Cards: make
.featuresa grid with 3 equal columns (repeat(3, 1fr)) and a24pxgap. - Hover effect: give
.feature-carda transition ontransform(for exampletransition: transform 0.2s ease) and lift it 4px in.feature-card:hoverwithtransform: translateY(-4px). - Phones: at 600px and below (
@media (max-width: 600px)), the cards stack in 1 column.
Each passing test breaks one of the Guardian's seals. Break all ten and the Grand Gallery is yours.
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 .