CSS transforms, online

Six activities your students do on their own devices. See who's finished, and their scores.

CSS transforms in one minute

What students need to know

translateX updates the element layout position along the horizontal plane by a fixed length unit. translateY operates explicitly on vertical offset dimensions to push elements up or down.

The transform property alters visual coordinates, whereas transition governs property animation speeds. The rotate function specifies an angle of geometric turn, measured with the degree (deg) unit suffix.

Mistakes students make

  • Line 0 is incorrect because a property cannot be declared before the opening curly brace of a ruleset.
  • Line 0 is incorrect because the transform rule is declared outside the block bounds of the CSS selector.
  • Line 1 is incorrect because CSS properties are separated from values using a colon (:), not an equals sign (=).
  • Line 1 is incorrect because the function name is 'rotate', not 'rotating'.

Discover other journeys with this module

What students will learn in this module

Every question in Module 62

Quick questions

  1. Which property modifies an element's spatial layout via rotation, scaling, or translation?AtransformBtransition
  2. What is the correct value unit measurement for the rotate() transform function parameter?ApxBdeg
  3. Does scale(2) double the visual size of an element or move it forward by 2 pixels?ADoubles the visual sizeBMoves it by 2 pixels
  4. Which function moves an element horizontally along its lateral horizontal axis plane?AtranslateX()BtranslateY()
  5. Is transform: scale(1.5); valid CSS structural syntax layout markup?ANoBYes

Key terms

Students type the meaning of:

  • transform

Match the pairs

transform: rotate(90deg);Match it to what it does
transform: scale(2);Match it to what it does
Moves an element 50 pixels to the right along its horizontal baseline track.Match it to what it does
Moves an element 30 pixels downwards along its vertical coordinate column.Match it to what it does
transform: scale(2px);Match it to what it does
transform: rotate(45);Match it to what it does

Fill in the blanks

  1. .box {
      transform: ______(45deg);
    }

    Hint: Type the transform function used to spin an element around a fixed point

  2. .icon {
      transform: _____(1.5);
    }

    Hint: Type the transform function used to resize an element up or down

  3. .card {
      transform: _________(10px, 20px);
    }

    Hint: Type the transform function used to reposition an element along X and Y axes

  4. .btn:hover {
      _________: none;
    }

    Hint: Type the property name that controls visual rotation, scaling, and movement

  5. .item {
      transform: ______(2);
    }

    Hint: Type the function name that resizes an element only along its vertical Y-axis

Spot the error

Question 1

Atransform: scale(2); {B  display: block;C}

Question 2

A.button transform: rotate(90deg); {B  color: white;C}

Question 3

A.box {B  transform = rotate(180deg);C}

Question 4

A.card {B  transform: rotating(45deg);C}

Question 5

A.logo {B  width: 100px;C  transform: scale(2px);D}