Improve Compatibility with Browser Fallbacks121

Tell us what’s happening:

actually I am not understanding how to do this problem. Can any one help?

Your code so far


<style>
  :root {
    --red-color: red;
  }
  .red-box {
    background: var(--red-color);
    
    height: 200px;
    width:200px;
  }
</style>
<div class="red-box"></div>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.116.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/improve-compatibility-with-browser-fallbacks

Before the property that sets the background color using a variable, add another background property with the color set to red (using the name red).

background: green;
background: var(--green-color-variable);
1 Like
background: green;
background: var(--green-color); [There is no such code --green-color-variable which is mentioned above.  ]

It is just an example, I name the variable that to make it clear that it is a variable, that’s all.

But I don’t know what you mean by the statement “There is no such code”. If you mean the variable can’t be named that, then you are wrong. It would be a strange name to give it though.

:root {
  --green-color-variable: green;
}

div {
  height: 500px;
  width: 100%;
  background: var(--green-color-variable)
}