Complete the code to declare a CSS variable for the main color.
:root { --main-color: [1]; }CSS variables are declared with -- prefix and assigned a value like a color code.
Complete the code to use the CSS variable --main-color for text color.
p { color: var([1]); }var() inside the blank instead of just the variable name.To use a CSS variable, wrap its name with var() and include the two dashes.
Fix the error in the code to correctly use a CSS variable for background color.
div { background-color: var([1]); }The variable name must include the two dashes and match the declared variable exactly.
Fill both blanks to create a CSS variable and use it for border color.
:root { [1]: #ff6600; }
.box { border: 2px solid var([2]); }Declare the variable with two dashes and use the exact same name inside var().
Fill all three blanks to declare CSS variables and use them for background and text colors.
:root { [1]: #222222; [2]: #ffffff; }
.header { background-color: var([3]); color: var(--text-color); }Declare variables with two dashes and use the exact names inside var(). The background uses --bg-color and text uses --text-color.