Help. I don’t understand how to decide!

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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.

Challenge: Improve Compatibility with Browser Fallbacks

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

div {
    font-size: 12px;
    font-size: 1rem;
}

In this example, the last property overrides the same property previously defined. If the browser doesn’t understand the rem unit, the property used here will be font-size: 12px;
In challenge:

background: var(--red-color);

Internet Explorer will ignore the background color because it does not support CSS variables

1 Like

add another background declaration right before the existing declaration and set its value to red.

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

Thanks a looooooooooooooot!