Pseudo-classes
You’ve surely noticed that some elements change when you move the mouse pointer over them: a button gets darker, a link changes color. This is done with pseudo-classes.
A pseudo-class selects elements in a certain state. It starts with a colon and is usually written right after another selector. The pseudo-class :hover selects an element while the mouse pointer is over it:
li:hover {
color: purple;
}With this rule, a list item turns purple when you point at it, and gets its color back when you move the pointer away. You can add :hover to any selector, for example h2:hover or #breeds:hover.
Keep in mind that phones and tablets have no mouse pointer, so nothing important should be visible only on hover.
Instructions
- 1
Create a rule for
a:hoverthat sets a yellow background:background-color: yellow. Then move the mouse pointer over the links in the footer.