Skip to content
Codewilds

Lesson 17 of 29 · CSS Basics

Boss: Style a Profile Card with CSS

Boss battlehard100 XP1 min read

The Dull Golem blocks the way. Every test you pass deals damage — pass them all to defeat it and claim a loot chest.

Deep in the quarry below the Painted Cliffs stands the Dull Golem: a hulk of grey stone that drains the colour out of everything it touches. Its latest victim is Ember the dragon's profile card — plain black text on plain white. Paint it back to life, and the golem crumbles.

Battle plan

You already know almost everything this fight needs: selectors, colours, units, fonts and the box model. One new property finishes the look. border-radius rounds the corners of a box:

.badge {
  border-radius: 8px;    /* gently rounded corners */
}
.pill {
  border-radius: 999px;  /* more than half the height: a pill shape */
}

It works with or without a border, and it rounds the background too.

Assignment

The HTML is ready — write the CSS in the <style> element:

  1. Every element: box-sizing: border-box.
  2. body: the background colour #2b2622 and the font stack Arial, Helvetica, sans-serif.
  3. .card: the background colour #fdf6e3, width: 340px, margin: 48px auto, padding: 32px, a 3px solid #e8a33d border, border-radius: 16px and centred text.
  4. .name: the text colour #b5432c and the font stack Georgia, serif.
  5. .button: the background colour #e8a33d, the text colour #2b2622, padding: 10px 24px, border-radius: 999px, bold text and no underline.

Each passing test knocks a chunk of stone off the golem. Make all ten pass to bring the colour back.

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
Play the 7 free lessons

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 .

Write code ↓
HTML & CSS+100 XP

Lesson 17 is part of the full course. The first 7 lessons are free.

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
Play the 7 free lessons

Want more than one course?

The All-Access Pass unlocks all 8 courses and every new one we release, for $120 once.