• Theory
  • Theory

Custom Properties, Mastery Challenge 2

Your task is to create some CSS variables and give them values.

The styles for this component are purposely placed inside the style tag in the HTML editor. The editor is locked, so you can only edit the styles where the CSS variables are set up.

You’ll find the possible variable names and values listed below. Just remember, the font size should be a multiple of 5.

color-gold,
color-purple,
color-orange,
title-font-size

#e64a19
#7b1fa2
#fbc02d

This is an extra challenge to help you practice and strengthen your skills with CSS Custom Properties.

Solution

The solution to the challenge will be available in a few minutes. Use it if you encounter difficulties. In the meantime, try to complete the challenge on your own.

:root {
  --color-gold: #fbc02d;
  --color-purple: #7b1fa2;
  --color-orange: #e64a19;
  --title-font-size: 25px;
}
  • index.html
HTML
HTML

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%