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
lasjorg
January 26, 2019, 7:30pm
#2
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
pkusaha
January 28, 2019, 10:20am
#4
background: green;
background: var(--green-color); [There is no such code --green-color-variable which is mentioned above. ]
lasjorg
January 28, 2019, 11:07am
#5
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)
}