Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1a:hover | AWrong — a dot selects a class, not a state. Use a colon: a:hover | |
| 2input:focus | BStyles an input when it receives keyboard or click focus | |
| 3Targets the last child element in a parent | CWrong — pseudo-classes use one colon, not two. Use button:active | |
| 4Targets elements by their numeric position among siblings | Dli:last-child | |
| 5a.hover { color: red; } | Ep:nth-child(2) | |
| 6button::active { background: blue; } | FStyles a link when the mouse pointer is over it |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
pseudo-class — A keyword added after a selector with a colon that targets an element based on its state or position, e.g. :hover or :focus.a:hover {
color: red;
}input:focus {
outline: 2px solid blue;
}li:first-child {
font-weight: bold;
}li:last-child {
color: gray;
}button:active {
background: green;
}