Basic CSS: Change a variable for a specific area

Basic CSS: Change a variable for a specific area
0

#1

I’m having trouble with variables this is what my code looks like. I don’t understand what I’m doing wrong.

body {
    background: var(--penguin-belly, #c6faf1);
  }
  
  .penguin {
    
    /* add code below */
    var:(--penguin-belly,white);
    /* add code above */

#2

Figured out what I was doing wrong. I just needed --penguin-belly:white;


#3

To set a variable you need to write it like this:

–penguin-belly: #c6faf1;


#4

Thanks I’ve got it to work consistently now.