add drop down menu using CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

add drop down menu using CSS

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 {<!-- w  w w.j av  a2 s. c om-->
   position:relative;
   height:111px;
}

#menu ul {
   margin:0px;
   padding:0px;
   float:left;
   line-height:111px;
}

#menu li {
   list-style:none;
}

#menu>ul>li {
   float:left;
   margin-right:2px;
   position:relative;
}

#menu>ul>li ul {
   height:100%;
   position:absolute;
   bottom:-100%
}

#menu>ul>li ul>li {
   bottom:0px;
   display:none;
   width:16em;
   float:left;
}

#menu>ul>li:hover ul>li {
   display:block
}

#menu a {
   display:block;
   padding:0px 31px;
   text-decoration:none;
   text-transform:uppercase;
   color:Chartreuse;
   background:yellow;
}

#menu a:hover {
   text-decoration:none;
   cursor:pointer;
   background:blue;
}
</style> 
 </head> 
 <body> 
  <div id="menu"> 
   <ul> 
    <li> <a href="index.html" accesskey="1" title="">Lore</a> </li> 
    <li> <a href="services.html.html" accesskey="2" title="">Lorem ip</a> 
     <ul> 
      <li> <a href="#">Lorem ipsum dolo</a> </li> 
      <li> <a href="#">Lore</a> </li> 
     </ul> </li> 
    <li> <a href="faq.html" accesskey="3" title="">Lor</a> </li> 
    <li class="active"> <a href="about.html" accesskey="4" title="">Lorem</a> </li> 
    <li> <a href="contact.html" accesskey="5" title="">Lorem ipsu</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials