Menu bar with dropdown menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Menu bar with dropdown menu

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
nav.navigation {<!--from   w  w  w. j a v  a 2 s.c  o  m-->
   clear:both;
   overflow:visible;
}

ul#menuElem {
   text-align:center;
   background-color:Chartreuse;
   border-top:7px solid yellow;
   margin-bottom:31px;
}

ul#menuElem>li {
   display:inline-block;
   position:relative;
   margin:17px 0 16px 0;
}

ul#menuElem>li>a {
   color:blue;
   text-decoration:none;
   padding:16px 36px;
   font-weight:601;
   text-transform:uppercase;
   border-right:2px solid;
   margin:16px 0;
   margin-left:-5px;
}

ul#menuElem>li>a:hover {
   background-color:pink;
}

ul#menuElem>li>ul {
   display:none;
   width:100%;
   float:left;
}

ul#menuElem>li:hover ul {
   display:block;
   top:31px;
   right:0px;
   position:absolute;
   background:OrangeRed;
   padding:0px;
   margin:0px;
}

ul#menuElem>li:hover>ul>li {
   margin:0px;
   padding:0px;
   list-style:none;
   text-align:left;
   padding:6px;
   line-height:31px;
   border-bottom:2px solid grey;
}

ul#menuElem>li:hover>ul>li>a {
   text-decoration:none;
   color:BlueViolet;
}

ul#menuElem>li:hover>ul>li:hover {
   background:Chartreuse;
   color:yellow;
}

ul#menuElem>ul>li {
   display:block;
}
</style> 
 </head> 
 <body translate="no"> 
  <nav class="navigation"> 
   <ul id="menuElem" class="navCMSListMenuUL"> 
    <li class="navCMSListMenuLI"> <a class="my" href="#">Lore</a> </li> 
    <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ip</a> </li> 
    <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ip</a> </li> 
    <li class="navCMSListMenuHighlightedLI noseparator"> <a class="myHighlighted" href="#">Lorem i</a> 
     <ul class="navCMSListMenuUL"> 
      <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ipsum dol</a> </li> 
      <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ipsum do</a> </li> 
      <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ipsu</a> </li> 
      <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ipsum dol</a> </li> 
      <li class="navCMSListMenuLI"> <a class="my" href="#">Lorem ipsum dol</a> </li> 
      <li class="navCMSListMenuLI noseparator"> <a class="my" href="#">Lorem ipsum dolor</a> </li> 
     </ul> </li> 
   </ul> 
  </nav>  
 </body>
</html>

Related Tutorials