make pure CSS dropdown menu appear with a fade in/slowly - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

make pure CSS dropdown menu appear with a fade in/slowly

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 {<!-- w w  w  .j av  a2 s.co m-->
   z-index:5;
   font-family:'Kameron', serif;
   font-size:15px;
   margin:0;
   padding-top:6px;
   padding-left:26px;
   list-style:none;
}

ul li {
   z-index:81;
   position:relative;
   float:left;
}

li ul {
   display:none;
}

ul li a {
   z-index:7;
   display:block;
   text-decoration:none;
   color:Chartreuse;
   padding:19px 0px 0px 0px;
   background:none;
   margin-right:13px;
   white-space:nowrap;
}

ul li a:hover {
   z-index:100;
   color:yellow;
   background:none;
}

li:hover>ul {
   display:block;
   opacity:0;
   z-index:99;
   position:absolute;
   -webkit-animation:fadein 3s;
   -moz-animation:fadein 3s;
   -ms-animation:fadein 3s;
   -o-animation:fadein 3s;
   animation:fadein 3s;
}

li:hover li {
   z-index:78;
   float:none;
   font-size:12px;
}

li:hover a {
   z-index:19;
   background:blue;
}

li:hover li a:hover {
   z-index:12;
   background:white;
}

#menu li {
   font-family:'Arial', sans-serif;
}

#menu {
   height:61px;
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat left top;
   font-family:'Kameron', serif;
}

@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> 
  <li> <a href="/emergencyservices/whatwedo.php" accesskey="3" title="">Lorem ipsum dolor s</a> 
   <ul> 
    <li> <a href="/emergencyservices/whatwedo.php">Lorem ipsum</a> </li> 
    <li> <a href="/emergencyservices/howstaffed.php">Lorem ipsum dolor s</a> </li> 
    <li> <a href="/emergencyservices/referralemerghandling.php">Lorem ipsum dolor sit amet, co</a> </li> 
    <li> <a href="/emergencyservices/typesofemerg.php">Lorem ipsum dolor sit</a> </li> 
    <li> <a href="/emergencyservices/whattoexpect.php">Lorem ipsum dolor sit amet</a> </li> 
   </ul> </li>  
 </body>
</html>

Related Tutorials