Improve Compatibility with Browser Fallbacks need help

Improve Compatibility with Browser Fallbacks need help
0

#1

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

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


#2

i have the same problem


#3

Add another background declaration right before this declaration and set its value to red.


#4

<style>

:root {

–red-color: red;

}

.red-box {

background: red;

background: var(–red-color);

height: 200px;

width:200px;

}

</style>

<div class=“red-box”></div>


#5

Hey @rikta,
Always use the “preformattted text (</>) ” button in the reply window to put your code on forum.


#6
<style>
  :root {
    --red-color: red;
  }
  .red-box {
    background: red;
    background: var(--red-color);
    height: 200px;
    width:200px;
  }
</style>
<div class="red-box"></div>

#7

thank, i learned it now :slight_smile:


#8

I had the same problem and just solved it. Thanks to this post!