Home
CSS
CSS Opacity
Tryit: Change the opacity on hover
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> img:hover { opacity: 0.5; } </style> </head> <body> <h1>Image Transparency</h1> <p>The opacity property is often used together with the :hover selector to change the opacity on mouse-over:</p> <img src="img_forest.jpg" alt="Forest" width="170" height="100"> <img src="img_mountains.jpg" alt="Mountains" width="170" height="100"> <img src="img_5terre.jpg" alt="Italy" width="170" height="100"> </body> </html>