Improve Compatibility with Browser Fallbacks!

Tell us what’s happening:

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 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36.

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

Some browsers don’t support CSS variables. So in this case this line:

background: var(--red-color);

will fail. When it fails you don’t control the background color you end up with.

To avoid this you add a fallback background color:

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

If the second line fails, we already have a red color set by the first line.
If the second line is supported by the browser, it override the first line and set the background to what ever the --red-color variable is.