Hover to change background and offset - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Hover to change background and offset

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">
.container {<!--from www. jav a  2s.co  m-->
   width:100px;
   border:2px solid Chartreuse;
   text-align:center;
}

.heading:hover {
   width:100px;
   border:2px solid yellow;
   background-color:blue;
   position:relative;
   margin:5px 0;
   left:6px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="heading"> 
    <h1>Lorem</h1> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials