Home
CSS
CSS Pseudo-class
Tryit: Hover on div element
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> div { background-color: green; color: white; padding: 25px; text-align: center; } div:hover { background-color: blue; } </style> </head> <body> <p>Mouse over the div element below to change its background color:</p> <div>Mouse Over Me</div> </body> </html>