On Hover Menu List Items alignment - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Hover

Description

On Hover Menu List Items alignment

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">
.nav_bar {<!-- w w w .j a  va 2 s.  c  o  m-->
   margin-left:701px;
   margin-top:41px;
   position:absolute;
}

.nav_bar ul {
   list-style-type:none;
}

.nav_bar ul li {
   display:inline-block;
   text-align:center;
   float:left;
}

.nav_bar ul li a {
   text-decoration:none;
   padding:13px;
   margin:9px;
   font-size:21px;
   color:Chartreuse;
   position:relative;
}

.nav_bar ul li a::after {
   content:'';
   position:absolute;
   bottom:0;
   left:0;
   right:0;
   margin:auto;
   height:5px;
   background:yellow;
   transition:width .5s;
   width:0;
}

.nav_bar ul li a:hover::after {
   width:100%;
}
</style> 
 </head> 
 <body> 
  <div class="nav_bar"> 
   <ul> 
    <li> <a href="#">Lorem ip</a> </li> 
    <li> <a href="#">Lorem ip</a> </li> 
    <li> <a href="#">Lorem i</a> </li> 
    <li> <a href="#">Lorem ip</a> </li> 
    <li> <a href="#">Lorem ip</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials