Complete the code to define a variable for the main color.
$main-color: [1];The variable $main-color is assigned the color value #3498db. In SASS, variables start with $ and store values like colors.
Complete the code to use the variable $main-color for the background color.
body {
background-color: [1];
}$ sign before the variable.To use a SASS variable, include the $ sign before the variable name. Here, $main-color sets the background color.
Fix the error in the nested style by completing the selector for the h1 inside header.
header {
background: $main-color;
[1] {
color: white;
}
}In SASS, nested selectors are written simply by the element name. Here, h1 inside header is nested as h1.
Fill both blanks to create a nested style for nav inside header with a hover effect on links.
header {
[1]: $main-color;
nav {
a {
color: white;
&:[2] {
color: #f39c12;
}
}
}
}border instead of background for color.active instead of hover for mouse hover effect.The background property sets the color for header. The &:hover selector applies styles when the mouse is over the link.
Fill all three blanks to create a SASS map of colors and use it to set the border color.
$colors: ( primary: [1], secondary: [2] ); .box { border: 2px solid map-get($colors, [3]); }
map-get to access map values.The map $colors stores color values with keys primary and secondary. The map-get function retrieves the color by key. Here, the border uses the primary color.