CSS variables not working

Tell us what’s happening:
I don’t know why my code is not working.
CSS variables don’t seem to work.
Please help.
Thank you
I used the following code to declare a css variable:
—penguin skin: gray;
It doesn’t work for any of the exercises.

Can you be more specific, and can you show the code for the CSS and the HTML your trying to change, will be very helpful.

Thanks.

It’s not —penguin skin: gray; it should be --penguin-skin: gray; then when you want to use it, for example: background-color: var(--penguin-skin);

1 Like

I think it should be “penguin-skin:gray;”

Nah you declare a CSS variable with --, read more about CSS variables.

change your declaration: —penguin skin: gray; to

—penguin-skin: gray;

We must declare variables as --variable-name: value we don’t have to write the properties name, just value.
When using the variable, we use property: var(--variable-name).

Hi @urfrenznimubro!

Thank you for your answer. This post is two years old so I would suggest contributing to posts that are current.

Thanks!