CSS :not():hover selector - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

CSS :not():hover selector

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">
ul {<!--from w ww.  j  a va 2s .c  om-->
   list-style:none;
   margin:0;
   padding:0;
}

li {
   margin:6px 0;
   cursor:pointer;
}

li.child {
   background-color:Chartreuse;
   color:yellow;
}

ul.parent li:hover:not(.special) {
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <ul class="parent"> 
   <li class="child">Lorem </li> 
   <li class="child">Lorem </li> 
   <li class="child">Lorem </li> 
   <li class="child">Lorem </li> 
   <li class="special">Lorem ipsum </li> 
  </ul>  
 </body>
</html>

Related Tutorials