You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inju Michorius edited this page May 17, 2021
·
2 revisions
Another cool thing you can do with css is creating variables and use them when styling elements. If you don't like the color for example, you can change all color of your website by changing one variable. You can create css variables in an element, but if you want to use the variable everywhere it's best to use the selector :root.
After you've declared the variable, you can use it like the example below. When changing the variable name, you also have to change the name in the element.
body{background-color:var(--neptune);}
You can put anything in a css variable, so it does not have to be a color. It could also be a font, size, value, position etc.