• Theory
  • Theory

Custom Properties, Mastery Challenge 5

In this challenge, you only know the names of the existing variables. Your task is to use them to set the right properties for the elements.

The CSS rules are already in place, but they’re empty. Here are the variable and property names you’ll be working with:

width,
border-top-width,
height

--event-width
--event-border-width
--time-width
--image-placeholder-size

The actual variable values are hidden on purpose, so you can’t just use regular CSS values — you have to rely on the variables!

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.

.event {
  width: var(--event-width);
  border-top-width: var(--event-border-width);
}

.time {
  width: var(--time-width);
}

.image-placeholder {
  width: var(--image-placeholder-size);
  height: var(--image-placeholder-size);
}
  • index.html
HTML
HTML

You’ve gone to a different page

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

100%