Tell us what’s happening:
Your code so far
<style>
:root {
--red-color: red,red;
}
.red-box {
background: var(--red-color, red);
height: 200px;
width:200px;
}
</style>
<div class="red-box"></div>
Tell us what’s happening:
Your code so far
<style>
:root {
--red-color: red,red;
}
.red-box {
background: var(--red-color, red);
height: 200px;
width:200px;
}
</style>
<div class="red-box"></div>
You need to understand CSS Variables better. You have a mistake in your variable declaration. Please read and test all the examples from MDN official documentation or solve again all the challenges from freeCodeCamp that contain “CSS Variables”.
Basic CSS - Learn freeCodeCamp
Using CSS custom properties - MDN
Should be:
[spoiler]```
:root { --red-color: red; } .red-box { background: var(--red-color); height: 200px; width:200px; } ```[/spoiler]