Drop down menu with margin spacing - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Drop down menu with margin spacing

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">
@charset "utf-8";
* {<!--  ww w .  j  a  v a  2 s. c  om-->
   margin:0px;
   padding:0px;
}

.menu {
   background:none repeat scroll 0 0 Chartreuse;
   height:51px;
   line-height:51px;
   margin:0;
   padding:0;
   text-align:center;
}

.menu ul ul {
   display:none;
}

.menu ul li:hover>ul {
   display:block;
}

.menu ul {
   height:51px;
   line-height:51px;
   list-style:outside none none;
   margin:0;
   padding:0;
   position:relative;
   text-align:center;
}

.menu ul:after {
   content:"";
   clear:both;
   display:block;
}

.menu ul li {
   float:left;
   padding:0 11px;
}

.menu ul li:hover {
   background:yellow;
}

.menu ul li:hover a {
   color:blue;
}

.menu ul li a {
   color:pink;
   display:block;
   text-decoration:none;
}

.menu ul ul {
   background:none repeat scroll 0 0 OrangeRed;
   padding:0;
   position:absolute;
   top:100%;
}

.menu ul ul li {
   border-bottom:0 solid grey;
   border-top:0 solid BlueViolet;
   float:none;
   margin:0;
   padding:0;
   position:relative;
}

.menu ul ul li a {
   padding:11px;
   color:Chartreuse;
   display:block;
}

.menu ul ul li a:hover {
   background:red;
}

.menu ul ul ul {
   position:absolute;
   left:100%;
   top:0;
   padding:0;
}

.menu ul ul ul li {
   float:none;
   border-top:0px solid yellow;
   border-bottom:0px solid blue;
   position:relative;
}

.menu ul ul ul li a {
   color:pink;
}

.menu ul ul ul li a:hover {
   background:red;
}

.menu ul ul ul ul {
   position:absolute;
   left:100%;
}
</style> 
 </head> 
 <body> 
  <div class="menu" align="center"> 
   <ul> 
    <li> <a href="/barequipment" class="dropmenutext">Lorem ipsum d</a> 
     <ul> 
      <li> <a href="/barequipment/tills">Lorem</a> </li> 
      <li> <a href="/barequipment/furniture">Lorem ipsum d</a> </li> 
      <li> <a href="/barequipment/sundries">Lorem ipsum </a> </li>Lorem 
     </ul> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials