×

css · level 3 · unit 5 · lesson 2

  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

turns a box, and resizes it.

rotate turns a box clockwise around its middle. Angles are in degrees, written deg: 90deg is a quarter turn and 360deg a full circle. You can also write turns, so 0.25turn is that same quarter turn.

scale resizes how a box is drawn. 1 is normal, 1.1 is ten percent bigger and 0.5 is half. Give it two values to scale across and down separately.

Like translate, both leave the layout alone. A scaled card can overlap its neighbours, but it never pushes them.

<div class="sticker">Sale</div>
.sticker {
  display: inline-block;
  padding: 12px;
  rotate: -8deg;
  scale: 1.2;
  background-color: gold;
}

Press show my page to see it here.