Dropdown Menu Working - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Dropdown Menu Working

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">
ul {<!--from   ww  w .j  a  v a  2  s . c o  m-->
   margin:0;
   overflow:hidden;
   background-color:Chartreuse;
   list-style-type:none;
}

li {
   float:left;
}

li a {
   text-decoration:none;
   font-family:sans-serif;
   display:inline-block;
   color:yellow;
   padding:13px;
}

li a:hover {
   background-color:blue;
}

#dropdown {
   position:absolute;
   display:none;
   background-color:pink;
   min-width:141px;
}

#dropdown a {
   color:OrangeRed;
   text-align:left;
   padding:11px;
   display:block;
   text-align:left;
}

#dropdown a:hover {
   background-color:grey;
}

#dropbtn:hover  #dropdown {
   display:block;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li> <a href="#">Lore</a> </li> 
   <li id="dropbtn"> <a href="#">Lorem</a> 
    <div id="dropdown"> 
     <a href="#">Lorem </a> 
     <a href="#">Lorem</a> 
    </div> </li> 
   <li> <a href="#">Lorem ip</a> </li> 
  </ul> 
  <h3>Lorem ipsum dolor sit amet, consectet</h3> 
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>  
 </body>
</html>

Related Tutorials