CSS Dojo道場 · practice
All levels

Two percentage traps

Level 12 of 13

Your goal

Give the 300px-wide .parent a height of 200px. Then make .child fill it exactly (outer size 300 × 200) with padding: 10% on every side. That is 30px, because percentage padding uses the parent's width. Keep the padding inside that size.

Must useheight
Elements

Hover one to find it on the stage. Click it, or put your cursor inside its CSS rule, to focus on just that element.

marginborderpaddingcontenttarget content boxtarget outer edge (green = matched, red = not yet)your element (hovered or focused)
Feedback updates as you type, and your CSS is saved in this browser. Exact target numbers are in the Target panel.