Change image and text color when I hover any one of them - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Image

Description

Change image and text color when I hover any one of them

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:hover #glo {<!--  ww  w.ja  v  a  2s  .  co  m-->
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png') ;
}

ul:hover a {
   color:Chartreuse;
}

ul #glo {
   width:301px;
   height:201px;
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png') ;
}

ul a {
   color:yellow;
}
</style> 
 </head> 
 <body> 
  <ul id="recherche"> 
   <li> <a href="#"> <img id="glo" src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> </a> </li> 
   <li> <a href="#">Lorem ips</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials