Handle Nested hover events Effect in CSS

     In this tutorial i am create Handle to Nested Hover Events in css .
 the box should be same color but if you have hover the mouse in 
all the box will be change their color and hover from the mouse 
will be effect from the different color . you can try to this code and 
run . demo will be below the code .

<!DOCTYPE html>
<html>
  <head>
    <style type='text/css'>
      .link-wrap {
        background-color: lightgray;
        overflow: auto;
        display: inline-block;
      }

      .link-panel {
        width: 100px;
        line-height: 100px;
        text-align: center;
        background-color: blue;
        color: white;
        float: left;
        margin: 10px;
      }

      .link-wrap:hover .link-panel {
        background-color: red;
        color: black;
      }

      .link-wrap .link-panel:hover {
        background-color: green;
        color: white;
      }
    </style>
  </head>
<body>
   <div class="link-wrap">
     <div class="link-panel">Link 1</div>
     <div class="link-panel">Link 2</div>
     <div class="link-panel">Link 3</div>
     <div class="link-panel">Link 4</div>
   </div>
</body>
</html>




Comments

Popular posts from this blog

Shutdown Computer With Funny Reason

Hidden Attribute in javascript

Draw animated loading spinner canvas in Javascript