Vertical CSS dropdown menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Vertical CSS dropdown 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  w  w  . j a  v a  2s.  c  o m-->
   position:absolute;
   left:51%;
   bottom:86.126%;
   z-index:100;
   height:100px;
   margin-top:-201px;
   width:301px;
   margin-left:-151px;
}

ul {
   list-style-type:none;
   padding:0;
   margin:0;
}

ul#nav li {
   background:Chartreuse;
   float:left;
}

ul#navbar li a {
   display:block;
   text-decoration:none;
   border-bottom:2px solid yellow;
   color:blue;
   padding:6px 16px;
}

ul#navbar li ul li a {
   color:pink;
}

ul#navbar li a:hover {
   background:OrangeRed;
}

ul#navbar li ul li {
   float:none;
}

ul#navbar li ul {
   position:absolute;
   display:none;
}

ul#navbar li:hover ul {
   display:block;
   background:black;
   color:grey;
}

body {
   margin:0px;
   padding:0px;
}
</style> 
 </head> 
 <body> 
  <header> 
   <!-- input for header text--> 
  </header> 
  <div id="menu"> 
   <!-- input for the navigation menu --> 
   <ul id="navbar" style="display: -moz-inline-box"> 
    <li> <a href="hem.html" id="hem">Lor</a> </li> 
    <li> <a href="#" id="browsers">Lorem ip</a> 
     <ul> 
      <li> <a href="chrome.html">Lorem </a> </li> 
      <li> <a href="firefox.html">Lorem i</a> </li> 
      <li> <a href="ie.html">Lo</a> </li> 
      <li> <a href="opera.html">Lorem</a> </li> 
     </ul> </li> 
    <li> <a href="data.html" id="data">Lorem</a> </li> 
    <li> <a href="synpunkt.html" id="synpunkt">Lorem ip</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials