Text styling, online

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

Text styling in one minute

What students need to know

line-height sets how tall each line is, so it changes the gap between lines. text-decoration controls lines drawn on text. The value none removes them.

text-transform changes how the text looks only. The words in the HTML stay as they were typed. color changes the text. background-color changes the area behind the text.

Mistakes students make

  • middle is not a text-align value. It should be text-align: center; to put the text in the middle.
  • no is not a valid value. It should be text-decoration: none; to remove the underline.
  • The text-transform declaration has no semicolon. It should be text-transform: uppercase; before the next declaration.
  • The property name has a space instead of a hyphen. It should be line-height: 1.6; written as one hyphenated word.

Discover other journeys with this module

What students will learn in this module

Every question in Module 42

Quick questions

  1. Which declaration centres text inside its container?Atext-align: center;Balign-text: middle;
  2. Which declaration removes the underline from a link?Atext-underline: off;Btext-decoration: none;
  3. What does text-transform: uppercase do?ARewrites the words in the HTML as capitalsBShows the letters as capitals without changing the HTML
  4. What does line-height control?AThe space between lines of textBThe height of each letter
  5. Which property sets the colour of the text itself?AcolorBtext-color

Key terms

Students type the meaning of:

  • text-align

Match the pairs

text-align: center;Match it to what it does
text-decoration: underline;Match it to what it does
text-transform: capitalize;Match it to what it does
The space between lines of textMatch it to what it does
text-align: middle;Match it to what it does
text-colour: red;Match it to what it does

Fill in the blanks

  1. p {
      text-align: ______;
    }

    Hint: Type the value that centres the text

  2. a {
      text-decoration: ____;
    }

    Hint: Type the value that removes the underline from a link

  3. h2 {
      ______________: uppercase;
    }

    Hint: Type the property that changes the letter case of text

  4. p {
      ___________: 1.5;
    }

    Hint: Type the property that sets the space between lines of text

  5. h1 {
      letter-spacing: ___;
    }

    Hint: Type the value 2px to add a little space between letters

Spot the error

Question 1

Ap {B  text-align: middle;C}

Question 2

Aa {B  text-decoration: no;C}

Question 3

Ah1 {B  text-transform: uppercaseC  color: navy;D}

Question 4

Ap {B  line height: 1.6;C}

Question 5

Ah2 {B  text-colour: red;C}