I can't see the problem

Tell us what’s happening:
Your .red-box rule should include a fallback with the background set to red immediately before the existing background declaration.

I literally have no clue what I should do. I have tried adding in a background: red; line above the background with variable but it still says the line above.

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

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

background: red;

its asking to set the “background-color”

what you have done is right, but missing a hyphen and the word “color”.

try this

background-color: red;

background could be anything, you then specify a color, but you need to specify that you want a coulor to fall back on.

hope this helps!

strange. this doesnt seem to work for me

HI :slight_smile:

Let’s improve our browser compatibility by adding another background declaration right before the existing declaration and set its value to red.

Your code is okay:
background: var(--red-color, red); is right, but in this exercice, they ask you to add a declaration, not modify the existing one :wink:

PS : background:red; is right @Michael3353: background - CSS : Feuilles de style en cascade | MDN

this worked for me:

  .red-box {
    background: red;
    background: var(--red-color);
    height: 200px;
    width:200px;
  }
1 Like

yeah i saw the mistake soon as i posted. remove from the modification. i realized soon as i posted, and was halfway through my apology then you posted lol so i have to re-write the apology lol.

1 Like

No worries! :slight_smile:
Have a good day!