Skip to main content

CSS Universal Selector — exercises and bug fixes

5 hands-on exercises and 5 find-the-bug challenges for the CSS Universal Selector lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.

Exercises(5)

  1. 1

    Reset with the universal selector

    easy10 min

    Set box-sizing on every element.

  2. 2

    Zero every margin

    easy10 min

    Remove margins from all elements.

  3. 3

    Scope the universal selector

    easy10 min

    Make every element inside #one red.

  4. 4

    Set a shared font size

    easy10 min

    Give every element a 20px font size.

  5. 5

    Combine universal with a class

    medium10 min

    Target every descendant of .card.

Find the bug(5)

  1. 1

    Fix the wrong wildcard character

    easy8 min

    The universal selector is *, not %.

  2. 2

    Fix the universal used where a class was meant

    easy8 min

    This resets everything instead of just the cards.

  3. 3

    Fix the missing space

    easy8 min

    Without a space this targets an element that is both.

  4. 4

    Fix the reset that missed

    easy8 min

    Only paragraphs got the padding; every element was intended.

  5. 5

    Fix the misspelled property in the reset

    easy8 min

    The property is box-sizing.

Ready to write the code?

The editor, the automatic checks and the worked solutions open up with an account.

Open the workspace