Hey can anybody tell me how to this task about variable and its fallback value

hey, so the task is to assign a fallback property to a variable and I tried to do the by several and and so many times but it doesn’t worked .

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


User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36.

Challenge: Improve Compatibility with Browser Fallbacks

Link to the challenge:

It wants you to set the fallback on a separate line. Leave the line where the var is used, and set the background again on the line before, hardcoding the value.

You can use the Reset All Code button to start over.


A great hint they leave is a “blank line” between two lines of code. That is the right place to type code in.

1 Like

thanks a lot it worked:)

thanks a lot it worked :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.