Dropdown Menu with various color - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Dropdown Menu with various color

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
body {<!--   w ww .ja v  a  2s.co m-->
   margin:0;
   padding:0
}

ul {
   list-style-type:none;
   margin:0;
   padding:0;
   overflow:hidden;
   background-color:Chartreuse;
}

li {
   float:left;
}

li a, .dropbtn {
   display:inline-block;
   color:yellow;
   text-align:center;
   padding:15px 17px;
   text-decoration:none;
}

li a:hover, .dropdown:hover .dropbtn {
   background-color:blue;
}

li.dropdown {
   display:inline-block;
}

.dropdown-content {
   display:none;
   position:absolute;
   background-color:pink;
   min-width:161px;
   box-shadow:0px 9px 17px 0px OrangeRed;
   z-index:2;
}

.dropdown-content a {
   color:grey;
   padding:13px 17px;
   text-decoration:none;
   display:block;
   text-align:left;
}

.dropdown-content a:hover {
   background-color:BlueViolet;
}

.dropdown:hover .dropdown-content {
   display:block;
}

.nav2 ul {
   list-style-type:none;
   margin:0;
   padding:0;
   overflow:hidden;
   background-color:Chartreuse;
}

.nav2 li {
   float:left;
}

.nav2 li a, .dropbtn2 {
   display:inline-block;
   color:yellow;
   text-align:center;
   padding:15px 17px;
   text-decoration:none;
}

.nav2 li a:hover, .dropdown2:hover .dropbtn2 {
   background-color:blue;
}

li.dropdown2 {
   display:inline-block;
}

.dropdown2-content {
   display:none;
   position:absolute;
   background-color:pink;
   min-width:161px;
   box-shadow:0px 9px 17px 0px OrangeRed;
   z-index:2;
}

.dropdown2-content a {
   color:grey;
   padding:13px 17px;
   text-decoration:none;
   display:block;
   text-align:left;
}

.dropdown2-content a:hover {
   background-color:BlueViolet;
}

.dropdown2:hover .dropdown2-content {
   display:block;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li> <a href="#home">Lore</a> </li> 
   <li> <a href="#news">Lore</a> </li> 
   <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Lorem ip</a> 
    <div class="dropdown-content"> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
    </div> </li> 
   <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Lorem ips</a> 
    <div class="dropdown-content"> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
    </div> </li> 
  </ul> &nbsp; 
  <ul> 
   <li> <a href="#home">Lore</a> </li> 
   <li> <a href="#news">Lore</a> </li> 
   <li class="dropdown2"> <a href="javascript:void(0)" class="dropbtn2">Lorem ip</a> 
    <div class="dropdown2-content"> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
    </div> </li> 
   <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Lorem ips</a> 
    <div class="dropdown-content"> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem </a> 
    </div> </li> 
  </ul> 
  <h3>Lorem ipsum dolor sit amet, consectet</h3> 
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>  
 </body>
</html>

Related Tutorials