Image Opacity in CSS

Here we look at an example in which we take a Transparent Image and when we put our mouse over on this Image the Image will be Clear.
Complete Program:
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <style type="text/css">
  5. img
  6. {
  7. opacity: 0.5;
  8. filter: alpha(opacity=50);
  9. }
  10. img:hover
  11. {
  12. opacity: 1.0;
  13. filter: alpha(opacity=100);
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <img src="Penguins.jpg" width="150" height="150" alt="Penguins" />
  19. </body>
  20. </html>
Output:
1.png
2.png