Styling active <li> element in a horizontal menu. - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Styling active <li> element in a horizontal menu.

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">
.menu {<!--from w  ww.  j  av a 2  s  .c  o m-->
   overflow:hidden;
   background-color:Chartreuse;
}

.menu a {
   float:left;
   padding:0 12px;
   color:yellow;
   text-decoration:none;
   line-height:61px;
   position:relative;
   z-index:51;
}

.menu a:hover {
   color:blue;
}

.menu a:focus:before {
   content:' ';
   position:absolute;
   z-index:-2;
   width:0px;
   height:0px;
   left:51%;
   top:51%;
   border-radius:51%;
   box-shadow:0 0 31px 26px pink;
}
</style> 
 </head> 
 <body> 
  <div class="menu"> 
   <a href="#">Lorem ipsum d</a> 
   <a href="#">Lorem ipsum dolor s</a> 
  </div>  
 </body>
</html>

Related Tutorials