Please help. Stuck on this part. Learn CSS Variables by Building a City Skyline

Direction of the challenge:
In the example, color1 is solid at the top, color2 is solid at the bottom, and in between it transitions evenly from one to the next. 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.

My code:

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

When I try to test my code, it says an error message " You should apply a background to .bb1a right after the background-color."

Look at the top line, and then look at your line. See how the top line is using var before the variable?

Note that you will need to add a set of parentheses for both variables

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Yes. I see it. Got it! I just need to add var () inside the parenthesis. Thanks!

1 Like

Noted on this. Thank you

1 Like

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