Improve Compatibility with Browser Fallbacks 13

Tell us what’s happening:

I tried the code before and have read some of the other forum posts, but still nothing worked.

Your code so far


<style>
  
  :root {
    
    --red-color: red;
  }
  .red-box {
  background: red;
    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 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

1 Like

Hi,

Look at your var(...).

There’s something out of place inside it.

Compare that to this sample code on MDN (line 5-7).