We would like to know how to change the opacity of image on hover.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
img {<!--from www . ja v a 2 s.co m-->
opacity: 0.5;
filter: alpha(opacity = 40);
}
img:hover {
opacity: 1.0;
filter: alpha(opacity = 100);
}
</style>
</head>
<body>
<img src="http://www.java2s.com/style/download.png" />
</body>
</html>
The code above is rendered as follows: