Improve Compatibility with Browser Fallbacks -thought I had the right solution but still got bug

Tell us what’s happening:
Although I’ve done what was requested, putting another background: red declaration, I still get an error msg.

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 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36.

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

You did correctly add the background as instructed but for some reason you incorrectly add ‘red’ to the variable where it wasn’t called for.

1 Like