Fallbacks error

Tell us what’s happening:

Hello everyone, I am learning about fallbacks and was wondering what is wrong with my code.
My .red-box rule should include a fallback with the background set to red immediately before the existing background declaration.

Thanks

Your code so far


<style>
  :root {
    --red-color: red;
  }
  .red-box {
    /*change code below */
    background: var(--red:color);

    background: var(--red-color);
    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_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.

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

.red-box {
    // The first background property will be the fallback to a basic red
    background: red;
    // If the user's browser supports CSS variables, the value of the 'red-color' variable will override the 'red' set on the line above.
    background: var(--red-color);
    height: 200px;
    width:200px;
  }

That worked thank you !

1 Like

yes!! the code worked. Thank you!