CSS Property Value How to - opacity: 1;








Question

We would like to know how to opacity: 1;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.description {<!--from  w  w  w.j  a v  a  2  s.c om-->
  opacity: 0;
}

img:hover+.description {
  opacity: 1;
}
</style>
</head>
<body>
  <div class="section">
    <img src="http://placehold.it/100x100" />
    <div class="description">HELLO</div>
    <img src="http://placehold.it/100x100" />
    <div class="description">WORLD</div>
  </div>
</body>
</html>

The code above is rendered as follows: