Change background color on hover with background-size - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Change background color on hover with background-size

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">

div.testy {<!--from   ww  w .j  av  a 2 s .com-->
   border:1px solid black;
   font-size: 25px;
   color: orange;
}
div.testy:hover {
   background:red;
}


      </style> 
 </head> 
 <body> 
  <div class="testy" style="height:100px;background-image: url('https://www.java2s.com/style/demo/Firefox.png');background-repeat: no-repeat; background-size:contain;">
    test test test test
  </div>  
 </body>
</html>

Related Tutorials