Learn css variables by building a skyline step 24

Hi! I would love to know why the color that is set for the variables at first moment doesn’t work,

 --building-color1: #aa80ff;
  --building-color2: #66cc99;
  --building-color3: #cc6699;

and It is needed to put a fallback value to color, in order to see the color of the buildings.,

background-color: var(--building-color2, green);

Despite, I did the lesson and it works perfectly, I don’t understand what is wrong with the other colors and why they aren’t shown! Thanks!

Oh sorry! I was able to see in the following lesson what is the problem here. Variables, need to be declare in the :root selector. Thank you!

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