:activeSeleciona los elementos que estén activos; por ejemplo al hacerles clic.
| 1 | <!DOCTYPE html> |
| 2 | <html lang="es"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" |
| 6 | content="width=device-width"> |
| 7 | <title>Selector :active</title> |
| 8 | <style> |
| 9 | :active { |
| 10 | color: blue; |
| 11 | } |
| 12 | |
| 13 | span:active { |
| 14 | background-color: yellow; |
| 15 | } |
| 16 | </style> |
| 17 | </head> |
| 18 | <body> |
| 19 | <h1>Selector :active</h1> |
| 20 | <p><button>Haz Click</button></p> |
| 21 | <p><span>Haz Click</span></p> |
| 22 | </body> |
| 23 | </html> |