City Skyline | Step 44

Tell us what’s happening:
Describe your issue in detail here.

I cannot pass this one and can’t seem to find where I am going wrong. The instructions say:
Add a linear-gradient to .bb1d with orange as the first color, --building-color1 as the second, and --window-color1 as the third. Remember to use the gradient on the background property.

When I do this it keeps giving me an error saying to add background to .bb1d

  **Your code so far**

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





      **Your browser information:**

User Agent is: <code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36</code>

**Challenge:**  Step 44

**Link to the challenge:**
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-css-variables-by-building-a-city-skyline/step-44
2 Likes

Hi @rmosssuccess and welcome!!

I think you need to read carefully the instructions and check your syntax. This link it might help you as well:

Let us know if you have got it.
Happy coding!! :muscle:

ok il make it as simple as possiable

linear-gradient is only added to :
background: ;
and
background-image: ;

if you added linear to background color it will NOT work like this:
background-color: linear-gradient() ;

so restart step and simply add linear-gradient to the correct property

@rmosssuccess here is the solution;

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

Thats how your code should look like.

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

Hi,
I’m having trouble with this too, here is my code:

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

I also tried removing background-colour too since I guess it’s not needed.
It just says:
You should use the background on .bb1d .

I can’t see any typos and it’s actually working in the preview so no idea.

hey, welcome to the forum! when you ask for help, it’s always better to create your own topic!

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

Thanks but I thought duplicating topics was not good practice.

in this forum, it’s not good practice to have multiple topics on the same challenge from the same user, but it’s easier to help as many people as possible if everyone has their own topic

Ok got it, thanks for the info.