How To Make A Decent Drop Down Menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

How To Make A Decent Drop Down 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">
body {<!--from   www.  ja  va2  s .c  o m-->
   padding:0;
   margin:0;
   font-family:Lucida Grande, Helvetica, Arial, sans-serif;
   font-size:13px;
}

#navigation {
   position:fixed;
   float:right;
   z-index:2;
   top:0;
   width:100%;
   color:Chartreuse;
   height:36px;
   text-align:center;
   padding-top:16px;
   -webkit-box-shadow:0px 0px 9px 0px yellow;
   -moz-box-shadow:0px 0px 9px 0px blue;
   box-shadow:0px 0px 9px 0px pink;
   background-color:OrangeRed;
   color:grey;
}

#navigation a {
   font-size:15px;
   padding-left:16px;
   padding-right:16px;
   color:BlueViolet;
   text-decoration:none;
}

#navigation a:hover {
   color:Chartreuse;
}

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

ul li {
   display:block;
   position:relative;
   float:left;
   border:2px solid yellow;
}

li ul {
   display:none;
}

ul li a {
   display:block;
   background:blue;
   padding:6px 11px 6px 11px;
   text-decoration:none;
   white-space:nowrap;
   color:pink;
}

ul li a:hover {
   background:OrangeRed;
}

li:hover ul {
   display:block;
   position:absolute;
}

li:hover li {
   float:none;
}

li:hover a {
   background:grey;
}

li:hover li a:hover {
   background:BlueViolet;
}

#drop-nav li ul li {
   border-top:0px;
}
</style> 
 </head> 
 <body> 
  <div id="navigation"> 
   <ul> 
    <li> <a href="#">Lore</a> </li> 
    <li> <a href="#">Lorem</a> </li> 
    <li> <a href="#">Lorem </a> </li> 
    <li> <a href="#">Lorem ips</a> </li> 
    <li> <a href="#">Lorem i</a> 
     <ul> 
      <li> <a href="#">Lorem ipsum dolor</a> </li> 
      <li> <a href="#">Lorem ipsum dolor</a> </li> 
     </ul> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials