Why isnt this defaulting to red?

Tell us what’s happening:

Your code so far

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

You need to understand CSS Variables better. You have a mistake in your variable declaration. Please read and test all the examples from MDN official documentation or solve again all the challenges from freeCodeCamp that contain “CSS Variables”.
Basic CSS - Learn freeCodeCamp
Using CSS custom properties - MDN

Should be:


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