Use It Yourself
Start by changing working code, then rebuild familiar patterns, then finish with a mini website. Use the hints only when you need them.
1. Fix the cramped card
The card works, but the text is stuck against the border. Add one CSS property to give it breathing room.
Add space inside
CSS 2 · paddingGoal: make the content sit comfortably inside the card.
Need a hint?
padding. Try 20px.2. Separate the cards
These cards need space between them. Add margin to the card class.
Space outside
CSS 2 · marginNeed a hint?
margin: 20px; adds outside space on every side.3. Make the navbar
The HTML is ready. Rebuild the simple navbar from the lesson.
Recognisable website structure
HTML 2 + CSS 2- Remove the body margin.
- Give the nav a dark background and padding.
- Center the links.
- Make the links white, spaced apart and remove the underline.
Show useful properties
margin: 0; · background-color · padding · text-align: center · color · margin · text-decoration: none4. Rebuild the Road Racer card
Use the image, heading, paragraph and button. Your version does not have to be pixel-perfect. It should look clean and intentional.
Game card
HTML 2 + CSS 1–2- Center the card on the page.
- Add padding inside.
- Make the image fill the card.
- Center the content.
- Style the PLAY button.
Need a starting point?
margin: 30px auto, padding: 18px, text-align: center, border + radius. Image: width: 100%. Button: reuse your CSS 1 button skills.5. Read the shorthand
Say what each line means before opening the answer.
Clockwise challenge
Top → Right → Bottom → Leftpadding: 10px 20px;
margin: 10px 20px 30px;
padding: 10px 20px 30px 40px;
6. Build a mini games website
This is the important one. Combine the structures you already know instead of following one finished answer.
My Games
CSS 2 CHECKPOINTBuild a page with a navbar, heading, short intro, and one Road Racer card. If you finish quickly, duplicate the card and use ../images/8.png, 9.png or another image.
- Use
paddinginside the card. - Use
marginfor outside spacing. - Use
margin: autoto center the card. - Use
text-alignwhere appropriate. - Remove navbar link underlines.
- Style the button using CSS 1.
Want a starter structure?
<nav>...links...</nav>
<h1>My Games</h1>
<p>...</p>
<div class="game-card">...</div>CSS 2 memory check
paddingspace insidemarginspace outsidemargin: autocenter the boxtext-align: centercenter what's inside