Pls i dont know what to do

Tell us what’s happening:

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0.

Challenge: Improve Compatibility with Browser Fallbacks

Link to the challenge:

1 Like

Hello @samyprince. The challenge is telling you to add a background property with the value of red right before the existing background property. But, what you did instead is that you added "red" right before the var.

This challenge is for increasing the browser compatibility if you use varaibles in CSS. For example, a browser which does not support variables won’t show any background colors. To tackle this, adding another background property after the variable fixes the problem.

background: red; // this is for uncompatible browsers
background: var(--red-color); // this is for modern browsers.

Hope this helps!

am meant to include a fallback with the background set to red immediately before the existing background declaration pls tell me where to put it

1 Like

You should add another background property before the existing background property.

pls show me how :pleading_face:

Look at my long post.

it is not working
:weary:

@samyprince Can you copy and paste the code you are submitting here.

Hey @samyprince, you have an extra red here:

ok i am coming
:relieved: :hugs:

This is how you post code @samyprince

THANKS
:kissing_heart: :kissing_heart: :kissing_heart:

``

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

Or background-color: red; with an indention!

Hey @samyprince. Seems like you solved the problem yourself. Congrats!

Tell us what’s happening:

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"

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0.

Challenge: Improve Compatibility with Browser Fallbacks

Link to the challenge:

Change the last line of code to <div class="red-box"> </div>. And please stop creating duplicate topics.

mybad
:upside_down_face: