Create a CSS drop up menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Create a CSS drop up 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">
#nav {<!--from ww w .  j a  v  a 2s  .c o  m-->
   margin:0px;
   padding:0px;
   position:absolute;
   top:19px;
   display:block;
   left:314px;
}

#nav>li {
   list-style-type:none;
   float:left;
   display:block;
   margin:0px 11px;
   position:relative;
   padding:11px;
   width:100px;
}

#nav>li ul {
   position:absolute;
   bottom:100%;
}

#nav li:hover>ul {
   display:block;
}

#nav>li:hover {
   -moz-border-radius:11px;
   -webkit-border-radius:11px;
}

#nav li ul {
   margin:0px;
   padding:0px;
   display:none;
}

#nav li ul li {
   list-style-type:none;
   margin:11px 0 0 0;
}

#nav li ul li a {
   display:block;
   padding:6px 11px;
   color:Chartreuse;
   text-decoration:none;
}

#nav li ul li:hover a {
   color:yellow;
   -moz-border-radius:6px;
   -webkit-border-radius:6px;
}

#nav li span {
   cursor:pointer;
   margin:0px 11px;
   font-weight:bold;
}

#nav {
   margin-top:100px;
}
</style> 
 </head> 
 <body> 
  <nav id="nav"> 
   <li>Lorem ip 
    <ul> 
     <li>Lorem ipsu</li> 
     <li>Lorem ipsu</li> 
     <li>Lorem ipsu</li> 
     <li>Lorem ipsu</li> 
    </ul> </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
  </nav>  
 </body>
</html>

Related Tutorials