Complete the code to change the button background color when it is focused.
button:[1] {
background-color: lightblue;
}The :focus pseudo-class applies styles when the button is focused, such as when tabbed to.
Complete the code to change the button background color when it is being clicked.
button:[1] {
background-color: darkblue;
color: white;
}The :active pseudo-class applies styles while the button is being clicked or pressed.
Fix the error in the code to style the button when focused and active.
button:[1], button:active { outline: 3px solid orange; }
The :focus pseudo-class must be used to style the button when it is focused. The code correctly styles :active as well.
Fill both blanks to style a link with a red underline when hovered and a green underline when focused.
a:[1] { text-decoration-color: red; } a:[2] { text-decoration-color: green; }
:hover styles the link when the mouse is over it, and :focus styles it when keyboard focused.
Fill all three blanks to style a button with a blue border on focus, a yellow background on hover, and a gray background on active.
button:[1] { border: 2px solid blue; } button:[2] { background-color: yellow; } button:[3] { background-color: gray; }
:focus styles the border when the button is focused, :hover changes background on mouse over, and :active changes background while clicking.