Background Variable/Value

Hi guys,

May you please assist with the following:

Problem Statement:

That didn’t work. You should add a fallback value to a variable by putting it as the second value of where you use the variable like this: var(--variable-name, fallback-value) . The property will use the fallback value when there’s a problem with the variable. Add a fallback value of green to the background-color of .bb2 .

My Solution:

.bb2 {
  width: 10%;
  height: 50%;
  background-color: var(--background-color, green);
}

Hint: You should add a fallback value of green to the background-color property.

:pray:t6:

1 Like

Oh, link to the challenge:

Learn CSS Variables by Building a City Skyline: Step 23 | freeCodeCamp.org.

This is not --background-color value, but --building-color2 in the variable.
The ‘background-color’ is the property. You should only add the ‘green’ value to the existing variable.

1 Like

Please excuse the delay, it’s been a really long day.

That really helped.

Thank you so much :pray:t6: :sunflower:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.