Add highlight effect on outside the area of selection with CSS - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:id

Description

Add highlight effect on outside the area of selection with CSS

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.box {<!--  w ww.j a  va2  s . c om-->
   transition:.4s;
   background:Chartreuse;
   text-align:center;
   padding:3%;
   margin:3%;
   width:18%;
   float:left;
}

.container:hover .box {
   opacity:0.4;
   transition:.4s;
}

.box:hover {
   opacity:2 !important;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="box">
     Lorem 
   </div> 
   <div class="box">
     Lorem 
   </div> 
   <div class="box">
     Lorem 
   </div> 
   <div class="box">
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials