Lesson 3 of 8

Styling a card

Goal

Colors, padding and rounded corners

01

Explanation

HTML describes what an element is, and CSS describes how it looks. Every CSS rule starts with a selector that picks the elements, followed by the properties inside curly braces.

In the rule .card { background: #fff; }, the dot means the rule applies to elements that have the class named card.

padding is space inside an element, and margin is space outside it. Mixing the two up is one of the most common beginner mistakes.

02

Your task

Style the card: give it a background color, inner padding of at least 16 pixels and rounded corners, and give its heading a color that stands out.

Checks

4 checks
  1. The card has a background color
  2. Inner padding of 16px or more
  3. The corners are rounded
  4. The heading inside the card isn't black
03

Hints

0/3
index.html
Preview
index.html100%
–/4

Press “Run and check” to grade your code.

4 checks listed under “Your task”.