Web Design

The Box Model

Every HTML element is secretly a rectangle (a "box"), even if you can't see its edges. That box has, from the inside out: padding (space between the content and the box's own edge), a border (the edge itself), and margin (space between this box and everything around it).

Give something a background-color and some padding and you'll suddenly be able to SEE the box for the first time — that's the trick most page layouts are built on.

Your turn

Make a <div class="card"> with some text inside, then give .card a background-color, padding of at least 16px, and a border.

Output shows up here when you Run.
Ask JARVIS for a hint