Complete the code to define a CSS custom property named --main-color with the value blue.
<style>
:root {
[1]: blue;
}
</style>The correct syntax to define a CSS custom property is to start with two dashes, like --main-color.
Complete the code to use the CSS custom property --main-color as the background color.
<style>
div {
background-color: [1];
}
</style>var().To use a CSS custom property, wrap its name with var() and include the two dashes.
Fix the error in the code to correctly set the text color using the CSS variable --text-color.
<style>
p {
color: [1];
}
</style>var().The correct way to use a CSS variable is with var(--text-color), including the dashes and wrapped in var().
Fill both blanks to define a CSS variable --padding with value 1rem and use it for padding.
<style>
:root {
[1]: 1rem;
}
section {
padding: [2];
}
</style>var() when using.Define the variable with --padding and use it with var(--padding).
Fill all three blanks to define --font-size as 16px, use it for font size, and set a fallback of 14px.
<style>
:root {
[1]: 16px;
}
h1 {
font-size: var([2], [3]);
}
</style>Define the variable --font-size, then use var(--font-size, 14px) to apply it with a fallback.