Learn CSS Variables by Building a City Skyline - Step 40

I’m unsure what the issue is with my code. I’ve checked other forums on this topic and have tried using their code, however, it’s still saying there is an error. Does anyone able to help me please?

Instructions:

In .bb1a , add a background property below the background-color property. Set it as a gradient of type linear-gradient that uses --building-color1 as the first color and --window-color1 as the second.

Code:

.bb1a {
  width: 70%;
  height: 10%;
  background-color: var(--building-color1); 
  background: linear-gradient(--building-color1,--window-color1);
}

you are missing the var function to get the value from the variables

Do I still keep the linear-gradient function included then? Because I tried it without it, but then it says it’s missing from the code.

You need to add a brecket and var (var , before `linear-gradient colors values. And a bracket ‘)’ after your first variable name. Also add a var and brecket ‘var(’ before your second variable name.

1 Like

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