Command Palette

Search for a command to run...

Hectal
Phase 3: Values, Units and Colours
CSS · Exercise 3 of 5 PreviousNext
Beginner

Buttons that scale with em

Make the button padding and corner radius scale with each button's own text size.

At 16px text, a .btn must have 8px padding on top and bottom, 16px on the left and right, and a 6px border radius. The .btn.big button has 24px text and must get 12px, 24px and 9px automatically, without any extra padding rule for .big.

What Check tests

  1. The normal button has 8px / 16px padding
  2. The normal button has a 6px radius
  3. The big button still has 24px text
  4. The big button's padding grows to 12px / 24px
  5. The big button's radius grows to 9px

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.