Background: (property) linear-gradient (value) usage?

Hi fcc support,

I have a question on the use of linear gradient for step 40 on the building a city skyline tutorial. I am entering the following code and the background transitions from purple to black:

.bb1a {
background: linear-gradient(#aa80ff, black);
}

However; this code does not pass the step.
When I enter the following suggested code through the hint provided:

.bb1a {
background: linear-gradient(–building-color1, --window-color1);
}

No color change displays and the code does not pass. The hint indicates to start by using --building-color1 - which I am entering already. What should I consider entering for the code in this step ? What am I not entering correctly?

1 Like

Please link to the challenge when asking for help.


add a gradient of type linear-gradient to the background property with --building-color1 as the first color and --window-color1 as the second.

That looks like variables, which are used like this var(--some-variable)

Edit: here is a more complete example, I changed the variable names.

background: linear-gradient(var(--variable-one), var(--variable-two));
1 Like

Thank you for your assistance.

This should be the correct code

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

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