HTML Element Style How to - Hover one div to show another div








Question

We would like to know how to hover one div to show another div.

Answer


<!DOCTYPE html>
<html>
<head>
<style>
.div_two {<!--from www .  ja  va2s .c o m-->
  visibility: hidden;
}

.div_one:hover+.div_two {
  visibility: visible;
}
</style>
</head>
<body>
  <div class="div_wrapper">
    <div class="div_one">Image</div>
    <div class="div_two">description</div>
  </div>
</body>
</html>

The code above is rendered as follows: