9. Pseudo-classes: hover and focus
Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.
A pseudo-class styles an element in a particular state. :hover applies while the mouse is over an element. :focus applies when the element is selected with the keyboard. :first-child picks the first child.
Always style :focus too, so keyboard users can see where they are.
Ver ejemplo
a:hover {
text-decoration: underline;
}
button:focus {
outline: 3px solid orange;
}
✍️ Ahora te toca
Make .btn change its background to orange when hovered.