Add multiple style based on hovered element - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Add multiple style based on hovered element

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">
span {<!--from w w  w  . j a  v  a 2  s .  c  o m-->
   display:inline-block;
   outline:2px solid red;
   padding:6px;
}

span>i {
   float:right;
   height:21px;
   width:21px;
   outline:2px solid blue;
   cursor:pointer;
}

span>i:not(:last-child) {
   margin-left:11px;
}

span>i:hover, span>i:hover~i {
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <span> <i></i> <i></i> <i></i> <i></i> <i></i> </span>  
 </body>
</html>

Related Tutorials