Beginner CSS Flashcards
What are CSS custom variables?
They’re a powerful tool that allow you to change multiple values at once.
What is the syntax for CSS variables?
Double hyphen–
Example: –penguin: black;
How does var work in CSS when it comes to variables?
You can assign its value to other properties by referencing the name. It will change whatever element you are targeting to match its value.
What is the syntax for the var CSS variables?
var(–choosewhateverclassname): black;
What is a fallback value? What is the syntax?
The value that will be reverted to if the variable is not found.
background: var(–randomclassname, black);
What is :root?
It’s a pseudo class selector. Variables inside of it will be available globally and can be access from any other selector