Hover with span and css3 - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Hover with span and css3

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">
* {<!--from   w  ww.j ava2  s .  c  om-->
   box-sizing:border-box;
}

.navi {
   float:left;
   text-decoration:none;
   position:relative;
   color:Chartreuse;
   font-size:15px;
   padding:0 21px;
   line-height:41px;
}

.navi:hover {
   color:yellow;
}

.navi:before {
   content:'';
   position:absolute;
   top:100%;
   left:0;
   right:0;
   bottom:0;
   z-index:-2;
   background-color:blue;
   -webkit-transition:all 0.5s cubic-bezier(0.6, 0.7, 0.6, 0.96);
   transition:all 0.5s cubic-bezier(0.6, 0.7, 0.6, 0.96);
}

.navi:hover:before {
   top:0;
}
</style> 
 </head> 
 <body> 
  <a href="#" class="navi">Lore</a> 
  <a href="#" class="navi">Lorem</a>  
 </body>
</html>

Related Tutorials