Hover to show submenu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Hover

Description

Hover to show submenu

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">
.desktop_navigation a {
   color:Chartreuse;
   text-decoration:none;<!--from ww  w .  j  a v a2s.c om-->
   display:inline-block;
   padding:13px;
   transition:all 0.6s ease;
   -webkit-transition:all 0.6s ease;
   -moz-transition:all 0.6s ease;
   -o-transition:all 0.6s ease;
}

.desktop_navigation ul li:hover a {
   color:yellow;
   background:blue;
   text-decoration:none;
   display:inline-block;
   z-index:1003;
   padding:13px;
   transition:all 0.6s ease;
   -webkit-transition:all 0.6s ease;
   -moz-transition:all 0.6s ease;
   -o-transition:all 0.6s ease;
}

.desktop_navigation ul li ul li a:link,
.desktop_navigation ul li ul li a:visited,
.desktop_navigation ul li ul li a:active {
   z-index:1002;
   width:100%;
   display:block;
   color:pink;
   background:OrangeRed;
   transition:all 0.6s ease;
   -webkit-transition:all 0.6s ease;
   -moz-transition:all 0.6s ease;
   -o-transition:all 0.6s ease;
}

.desktop_navigation ul li ul li a:hover {
   width:100%;
   display:block;
   color:grey;
   z-index:1003;
   background:BlueViolet;
   transition:all 0.6s ease;
   -webkit-transition:all 0.6s ease;
   -moz-transition:all 0.6s ease;
   -o-transition:all 0.6s ease;
}

.desktop_navigation ul {
   list-style:none;
   padding:0;
   margin:0;
   padding-top:31px;
}

.desktop_navigation ul li {
   display:inline-block;
   position:relative;
   padding:0;
   margin:0;
   z-index:1003;
}

.desktop_navigation ul li ul {
   list-style:none;
   display:none;
   padding-top:0;
}

.desktop_navigation ul li:hover ul {
   display:block;
   position:absolute;
   top:100%;
   z-index:891;
}

.desktop_navigation ul li ul li {
   float:none;
   position:relative;
   min-width:181px;
   z-index:891;
}
</style> 
 </head> 
 <body> 
  <div class="desktop_navigation"> 
   <ul> 
    <li> <a href="#">Lorem </a> </li> 
    <li> <a href="#">Lorem </a> 
     <ul> 
      <li> <a href="#">Lorem ipsum </a> </li> 
     </ul> </li> 
    <li> <a href="#">Lorem </a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials