Stuck on Browser Fallbacks

Tell us what’s happening:

Code is not going through though it appears I might have the right code. What am I doing wrong?

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/81.0.4044.62 Mobile/15E148 Safari/604.1.

Challenge: Improve Compatibility with Browser Fallbacks

Link to the challenge:

1 Like

No need to add fallback value on var. You have already declared it above.
background: var(–red-color, red); //error line
Declare only var here, and not the fallback value.
Hope it helps.

Hey-hey!

The first line with background is right - but then, you should not write “red” inside of variable.
You have:

background: var(--red-color, red);

Should be:

background: var(--red-color);