Improve Compatibility with Browser Fallbacks Issues (Solved)

Tell us what’s happening:

Hi guys. Im from Argentina so if my english its not excellent dont panic :slight_smile:
I really dont understand why this is wrong, i put the “fallback” in order, i guess…
Im not a beeginer beeginer in html and css so i really understand this type of code, but i put the “fallback” color in different places and nothing happens.
Thanks for helping!!

Your code so far


<style>
  :root {
    --red-color: red;
    
  }
  .red-box {
    
    background: var(--red-color, red);
    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/76.0.3809.132 Safari/537.36.

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

Hi @Co2, welcome to the forum :smile:
I think that that the problem is this line:

It should be

background: var(--red-color);

like it was at the beginning of the challenge.
Before that, you should put another background declaration without using a variable.
So, something like this:

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

When the var is supported, the second declaration will override the first.

1 Like