Fill background color to drop down menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Fill background color to 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">
#nav, #nav ul {<!-- ww  w. j av a 2  s  . c  o m-->
   float:left;
   list-style:none;
   box-shadow:0px 2px 8px Chartreuse;
   background-color:yellow;
   border-radius:6px 6px 0px 0px;
   z-index:100;
}

#nav li a {
   display:block;
   padding:17px;
   text-decoration:none;
   font-weight:bold;
   color:blue;
   border-left:2px solid pink;
   font-size:2em;
}

#nav li a:hover {
   color:OrangeRed;
   background-color:grey;
}

#nav>li {
   float:left;
}

#nav li ul {
   position:absolute;
   width:12em;
   left:-1000em;
   border-radius:2px;
}

#nav li:hover ul, #nav li.sfhover ul {
   left:auto;
}
</style> 
 </head> 
 <body> 
  <ul id="nav"> 
   <li> <a href="#">Lore</a> </li> 
   <li> <a href="#">Lorem</a> </li> 
   <li> <a href="#">Lorem ip</a> </li> 
   <li> <a href="#">Lorem ips</a> 
    <ul> 
     <li> <a href="#">Lorem ip</a> </li> 
     <li> <a href="#">Lorem ipsum do</a> </li> 
     <li> <a href="#">Lorem ip</a> </li> 
     <li> <a href="#">Lorem ipsum d</a> </li> 
     <li> <a href="#">Lorem ipsum dolor </a> </li> 
    </ul> </li> 
   <li> <a href="#">Lorem i</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials