×

css · level 1 · unit 7 · lesson 4

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

A page is built from small rules working as a team.

is how the parts of a page are arranged: what sits where, how big, and how far apart. Every good layout is built from the small pieces you already know.

Start with the whole page on body: font and colour. Then shape each box with padding, borders and round corners. Then line the boxes up with flex.

Finish with the details, like a hover colour for anything clickable. When something looks wrong, check spelling, semicolons and curly brackets first, then which rule wins.

<div class="cards">
  <div class="card">Cats</div>
  <div class="card">Dogs</div>
  <div class="card">Fish</div>
</div>
.cards {
  display: flex;
  gap: 16px;
}
.card {
  padding: 24px;
  border-radius: 12px;
  background-color: #e0f2f1;
}

Press show my page to see it here.

Add a .card:hover rule of your own and run it again.