Add Class and style the closest span with class - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:hover

Description

Add Class and style the closest span with class

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <style type="text/css">
.goto:hover .arrow {<!--  w w w.  j a  va 2s .c  o m-->
   background: red;
}

      </style> 
   </head> 
   <body> 
      <span class="goto">
          Hover here 
         <span class="arrow">?</span> 
      </span> 
      <span class="goto">
          Hover here 
         <span class="arrow">?</span> 
      </span>  
   </body>
</html>

Related Tutorials