Complete the code to define a CSS variable for primary color.
:root { --primary-color: [1]; }CSS variables start with -- and are assigned values like colors directly. Here, #3498db is a valid color value.
Complete the code to use the CSS variable for background color.
button { background-color: [1]; }To use a CSS variable, you write var(--variable-name). This tells the browser to use the value stored in the variable.
Fix the error in the CSS nesting syntax using future CSS features.
nav {
[1] {
color: black;
}
}Future CSS nesting uses the & symbol to refer to the parent selector. To select a nested ul inside nav, use & ul.
Fill both blanks to create a CSS rule that applies styles only when the screen width is at least 600px.
@media ([1]: [2]) { body { font-size: 1.2rem; } }
The media feature min-width applies styles when the viewport is at least the given width, here 600px.
Fill all three blanks to create a CSS custom property with a fallback value and use it in a style.
:root { --main-color: [1]; } h1 { color: var([2], [3]); }-- in the variable name inside var().The custom property --main-color is set to #ff6347. The var() function uses --main-color with a fallback color #000000 if the variable is not set.