Learn CSS Variables by Building a City Skyline - Step 44

Tell us what’s happening:
I don’t know what the error is but every time I check the code it shows the error message:

Test

Sorry, your code does not pass. Keep trying.

Hint

You should use the background on .bb1d.

  **Your code so far**
.bb1d {
  width: 100%;
  height: 70%;
  background: linear-gradient(
    var(orange),
    var(--building-color1),
    (--window-color1)
    );
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33

Challenge: Learn CSS Variables by Building a City Skyline - Step 44

Link to the challenge:

1 Like

I saw that i forgott a var but when i checked the code is says the same like before:

Test

Sorry, your code does not pass. Keep trying.

Hint

You should use the background on .bb1d.

Can you post the code to your latest attempt?

@Louismmm you made lots of error in the syntax

.bb1d {
  width: 100%;
  height: 70%;
  background: linear-gradient(
      var(orange)
      var(--building-color1),
      var(--window-color1)
    );
}

remove the var from the orange color here orange is not a variable it is color

5 Likes

I removed the var from orange and it worked. Thanks

2 Likes

always welcome @Louismmm

1 Like

.bb1d {
width: 100%;
height: 70%;
background-color: var(–building-color1);
background: linear-gradient(
(orange),
var(–building-color1),
var(–window-color-1)
);
}
I removed the “var” from orange and it is still telling me that it is wrong. Is there something that I’m missing here? Please help me to understand as it is giving me the following error message below. Thanks.

Test

Sorry, your code does not pass. Try again.

Hint

You should use orange as the first color in the linear-gradient.

remove the bracket too in orange because it is value of the color in the code

1 Like

I was having the same issue as the others here but figured out the solution thanks to this thread. Why do we remove the bracket in this case?

.bb1d {
width: 100%;
height: 70%;
background: linear-gradient(
orange,
var(–building-color1),var(–window-color1)
);
} this is correct

.bb1d {
  width: 100%;
  height: 70%;
  
  background: linear-gradient(orange,
      var(--building-color1),
      var(--window-color1))
}

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