Border-radius and box-shadow, online

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

Border-radius and box-shadow in one minute

What students need to know

The first two 0 values represent horizontal and vertical offsets, followed by the blur radius. The border-radius property alters the curvature of the box corners.

A value of 50% rounds all corners relative to the dimensions, forming a circle from a square. The inset keyword places the shadow effect within the frame boundary.

Mistakes students make

  • Line 1 is incorrect because CSS properties use colons (:), not equal signs (=), to separate properties from values.
  • Line 2 is incorrect because border-radius requires a unit like px or %. A unitless 50 is invalid.
  • Line 0 is incorrect because a CSS ruleset must open with a curly brace {, not a colon :.
  • Line 3 is incorrect because box-shadow requires at least two size values (horizontal and vertical offset). A single value like 5px is invalid.
PREVIOUS · MODULE 58Backgrounds
YOU ARE HERE · MODULE 59Border-radius and box-shadow
NEXT · MODULE 60Media queries (responsive design)

Discover other journeys with this module

What students will learn in this module

Every question in Module 59

Quick questions

  1. Which property is used to create rounded corners in CSS?Aborder-radiusBbox-radius
  2. To turn a perfect square element into a perfect circle, which value should you apply to border-radius?A50%B100px
  3. Which keyword changes a box-shadow from an outer shadow to an inner shadow?AinsetBinside
  4. In box-shadow: 4px 8px 5px black;, what does the 5px value represent?AThe spread radiusBThe blur radius
  5. Is it possible to specify separate border-radius values for different corners of a single element?ANoBYes

Key terms

Students type the meaning of:

  • border-radius

Match the pairs

.box {
  border-radius: 50%;
}
Match it to what it does
.box {
  box-shadow: inset 0 0 5px black;
}
Match it to what it does
Applies a shadow with a 10px blur radius and no offsets.Match it to what it does
Rounds only the top-left and bottom-right corners of the container.Match it to what it does
.box {
  border-radius: 10;
}
Match it to what it does
.box {
  box-shadow: 5px 5px;
}
Match it to what it does

Fill in the blanks

  1. .btn {
      _____________: 5px;
    }

    Hint: Type the property that rounds element corners

  2. .circle {
      border-radius: ___;
    }

    Hint: Type the percentage value to make a perfect circle

  3. .box {
      __________: 5px 5px black;
    }

    Hint: Type the property used to add a drop shadow

  4. .card {
      box-shadow: _____ 0 0 5px red;
    }

    Hint: Type the keyword that makes the shadow an inner shadow

  5. .img {
      ______________________: 8px;
    }

    Hint: Type the property that targets only the top left corner

Spot the error

Question 1

A.box {B  border-radius = 10px;C  box-shadow: 2px 2px 2px #ccc;D}

Question 2

A.avatar {B  width: 50px;C  border-radius: 50;D  height: 50px;E}

Question 3

A.card:B  border-radius: 12px;C  box-shadow: 0 4px 6px black;D}

Question 4

A.button {B  border-radius: 4px;C  background-color: blue;D  box-shadow: 5px;E}

Question 5

A.window {B  border-round: 8px;C  box-shadow: 0 2px 4px rgba(0,0,0,0.2);D}