Complete the code to declare a CSS variable for the main color.
:root { --main-color: [1]; }The correct way to declare a CSS variable is to use a valid color value. Here, #3498db is a hex color code for a blue shade.
Complete the code to use the CSS variable for background color.
body { background-color: [1](--main-color); }var().use() or get().To use a CSS variable, you write var(--variable-name). Here, var(--main-color) applies the variable value.
Fix the error in the CSS variable declaration.
:root { [1]main-color: #ff6347; }var in the declaration.CSS variables must start with two dashes --. Here, adding -- before main-color fixes the declaration.
Fill both blanks to declare and use a CSS variable for font size.
:root { [1]font-size: 1.2rem; } p { font-size: [2](--font-size); }var() when applying the variable.Declare the variable with two dashes --font-size and use it with var(--font-size).
Fill all three blanks to declare and use CSS variables for color and padding.
:root { [1]primary-color: #2ecc71; [2]padding: 1rem; } div { color: [3](--primary-color); padding: var(--padding); }var() when applying.Declare variables with two dashes --primary-color and --padding. Use var(--primary-color) to apply the color.