Horizontal css menu with vertical sub/drop down menu. - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Horizontal css menu with vertical sub/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, div, p, h1, h2, h3, h4, h5, span {
   margin:0;
   padding:0;
}

div.spheader {<!--   w  w w.ja  va  2s.com-->
   width:100%;
   background:Chartreuse;
   height:32px;
}

.spheader ul.spmenu {
   border-right:2px solid yellow;
   margin:0 13px;
   position:relative;
   width:auto;
}

ul.spmenu {
   list-style:none;
   position:relative;
   display:inline-table;
}

.spheader ul.spmenu li {
   display:inline;
   font-size:14px;
   list-style:none outside none;
   margin:0;
   padding:0;
}

ul.spmenu li {
   height:32px;
   text-transform:uppercase;
}

ul.spmenu li a {
   background-image:none;
   border-left:2px solid blue;
   border-right:2px solid pink;
   height:32px;
   display:block;
}

ul.spmenu  li a {
   text-decoration:none;
   color:OrangeRed;
   display:inline;
   float:left;
   font-weight:bold;
   line-height:31px;
   position:relative;
   padding:0 11px;
   font-family:Arial,Helvetica,"Arial Unicode MS",sans-serif;
}

.spheader ul li ul {
   display:none;
}

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

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

.spheader ul li ul {
   background:grey;
   border-radius:0px;
   padding:0;
   position:absolute;
   top:100%;
}

.spheader ul li ul li {
   float:none;
   border-top:2px solid BlueViolet;
   border-bottom:2px solid Chartreuse;
   position:relative;
}

.spheader ul li ul li a {
   padding:0px 13px;
   color:yellow;
   position:relative;
   display:block;
}

.spheader ul li ul li a:hover {
   background:blue;
}

ul.spmenu  li ul li {
   clear:both;
   border-style:none;
}
</style> 
 </head> 
 <body> 
  <br> 
  <br> 
  <br> 
  <div class="spheader" style="width:100%;"> 
   <ul class="spmenu"> 
    <li> <a href="">Lore</a> </li> 
    <li> <a href="">Lorem ipsum </a> 
     <ul> 
      <li> <a href="">Lorem i</a> </li> 
      <li> <a href="">Lorem i</a> </li> 
      <li> <a href="">Lorem ips</a> </li> 
     </ul> </li> 
    <li> <a href="">Lorem ipsu</a> 
     <ul> 
      <li> <a href="">Lorem i</a> </li> 
      <li> <a href="">Lorem ip</a> </li> 
      <li> <a href="">Lorem </a> </li> 
     </ul> </li> 
    <li> <a href="">Lorem i</a> 
     <ul> 
      <li> <a href="">Lor</a> </li> 
      <li> <a href="">Lore</a> </li> 
      <li> <a href="">Lor</a> </li> 
     </ul> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials