CSS Property Value How to - hover to change border








Question

We would like to know how to hover to change border.

Answer


<!--from  w  w  w .  ja v  a  2s . c  om-->
<html>
    <head>
      <style type="text/css">
      div.section:hover div.image, div.section:hover div.layer {
        border: solid 1px red;
      }
      </style>
    </head>
    <body>
      <div class="section">
        <div class="image"><img src="http://www.java2s.com/style/download.png" /></div>
        <div class="layer">Lorem Ipsum</div>
      </div>
    </body>
</html>

The code above is rendered as follows: