Change colors while hovering css - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Color

Description

Change colors while hovering css

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

html,<!--from   ww  w  .j av a 2s.co  m-->
body,
.container {
   height: 100%;
   min-height: 100%;
}

.box {
   width: 191px;
   height: 145px;
   margin: 4px;
   float: left;
   background-color: black;
}

.box:hover {
   background-color: blue;
   opacity: 1;
   overflow: hidden;
}

.test:hover {
   background-color: pink;
   overflow: hidden;
}

.test {
   width: 191px;
   height: 145px;
   margin: 4px;
   float: left;
   position: absolute;
   z-index: 99;
}

.first {
   opacity: 0.1;
}

      </style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="test"></div> 
   <div class="first box"></div> 
   <div class="third box">
     third 
   </div> 
   <div class="second box">
     second 
   </div> 
   <div class="fourth box">
     fourth 
   </div> 
   <div class="last box">
     last 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials