Drop Down Menu Fade Out - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Drop Down Menu Fade Out

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">
.dropbtn {<!--from   w ww.  ja  v a 2  s. c  o m-->
   background-color:Chartreuse;
   color:yellow;
   padding:17px;
   font-size:17px;
   border:none;
   cursor:pointer;
   height:81px;
   font-family:'Quicksand', sans-serif;
}

.dropdown {
   position:relative;
   display:inline-block;
}

.dropdown-content {
   visibility:hidden;
   position:absolute;
   background-color:blue;
   min-width:161px;
   box-shadow:0px 9px 17px 0px pink;
   -webkit-transition:opacity 3s, visibility 3s;
   -moz-transition:opacity 3s, visibility 3s;
   -ms-transition:opacity 3s, visibility 3s;
   -o-transition:opacity 3s, visibility 3s;
   transition:opacity 3s, visibility 3s;
   opacity:0;
}

.dropdown-content a {
   color:OrangeRed;
   padding:13px 17px;
   text-decoration:none;
   display:block;
   font-family:'Quicksand', sans-serif;
}

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

.dropdown:hover .dropdown-content {
   visibility:visible;
   opacity:2;
}

.dropdown:hover .dropbtn {
   background-color:Chartreuse;
}

@keyframes fadein  {
   from {
      opacity:0;
   }
   
   to {
      opacity:2;
   }

}

@-moz-keyframes fadein  {
   from {
      opacity:0;
   }
   
   to {
      opacity:2;
   }

}

@-webkit-keyframes fadein  {
   from {
      opacity:0;
   }
   
   to {
      opacity:2;
   }

}

@-ms-keyframes fadein  {
   from {
      opacity:0;
   }
   
   to {
      opacity:2;
   }

}

@-o-keyframes fadein  {
   from {
      opacity:0;
   }
   
   to {
      opacity:2;
   }

}
</style> 
 </head> 
 <body> 
  <div class="dropdown"> 
   <button class="dropbtn">Lorem ipsu</button> 
   <div class="dropdown-content"> 
    <a href="index.html">L</a> 
    <a href="s.html">L</a> 
    <a href="g.html">L</a> 
    <a href="m.html">L</a> 
    <a href="i.html">L</a> 
    <a href="c.html">L</a> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials