添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I’m having an issue with step #40 the error is asking me to add a background to the bb1a class element. I have a background property with a linear-gradient function and added the variables. I tried looking up the linear-gradient function, but it’s asking me to add a background to bb1a.

here is my css code so far:

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

From what I see you’ve forgotten to call the variable with the var function within your linear-gradient function.

.bb1a {
width: 70%;
height: 10%;
background-color: var(–building-color1);
<!--  Look below here -->
background: linear-gradient(–building-color1, --window-color1);
<!-- Look above here -->
              

this is a helpful comment because the example syntax that is shown at step 40 is incorrect;

gradient-type(
 color1,
 color2

since this does not work;

background: linear-gradient( 
    var(--building-color1),
    var(--window-color1)

I tried your alternative method;

background: linear-gradient(var(--building-color1, --window-color1));

it did not work either.

This is not.

Can you post the code to your latest attempt of what you think should be correct?

Remember. To call variables, you need to call var() function and put the name of the variable inside the arguments (inside the brackets).

Hi @jasperstam

Can you post all of your CSS code using that method?

Enclose it in a triple backtick like this

```css
paste css codes here

That would be much appreciated

Hi @jasperstam.

I just posted a hint for this step and for this exact issue not long ago.

Take a look at this post: