Utilizor
Contact Us

CSS Exercises

Practice your CSS skills with hands-on exercises.

CSS Exercises

Practice makes perfect! Work through our CSS exercises to reinforce what you've learned.

Exercise 1: Selectors

Select all <p> elements and change their color to red.

Input:

<style>
  _____ {
    color: red;
  }
</style>

Answer: p

Exercise 2: Backgrounds

Set the background color of the page to "lightblue".

Input:

body {
  ___________: lightblue;
}

Answer: background-color

Example

/* Try to solve this: */
/* Change the font size of all h1 elements to 40px */
h1 {
  font-size: 40px;
}