Inheriting CSS variables and the root element

Hello everyone! I’ve just hit a roadblock and need a little help.

I’m on lesson 42 of Basic CSS which is ‘Inherit CSS variable’. The previous few lessons were also about CSS variables and I completed them but I didn’t really get a clear idea about what a CSS variable is. Is it the same as a ‘class’ or ‘ID’? Lesson 42 also mentions the ‘root’ element. I’ve looked around and found a few explanations but I’m having a hard time conceptualizing it. Won’t applying styles to the ‘root’ element be the same as applying them to the ‘body’ element?

If someone could explain these concepts may be through a metaphor or something easy to understand for a complete newbie, I’d really appreciate it. Thankyou :slight_smile:

CSS
Cascade style sheet

variable
a container that stores information

class
A group of elements that are simulair

ID
Just like u would have an ID tag in real life
CSS/HTML also uses them to identify and call up

Root
I always remeber this as root of a plant
its where it starts and lays it basic foundation

Won’t applying styles to the ‘root’ element be the same as applying them to the ‘body’ element?

It would very much not do that since the roots touch more then just a body element would

1 Like

Thank you @KittyKora!