CSS hover to start transition - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Animation

Description

CSS hover to start transition

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.sidenav {<!--from w w  w.  j  a  v a 2  s . c o m-->
   padding:0;
   margin:0;
   list-style:none;
}

ul.sidenav li {
   font-family:Arial,Helvetica, sans-serif;
   color:Chartreuse;
   margin:0 0 11px 0;
   padding:0;
   text-align:right;
}

ul.sidenav>li {
   padding:7px 21px;
   font-size:19px;
   box-shadow:inset 7px 7px 13px -9px yellow;
   line-height:27px;
   background:blue;
}

ul.sidenav>li#menu-item-98 {
   background:pink;
}

ul.sidenav>li#menu-item-108 {
   background:OrangeRed;
}

ul.sidenav li:hover {
   cursor:pointer
}

ul.sidenav li a {
   color:grey;
   text-decoration:none
}

ul.sidenav li a:hover {
   color:BlueViolet;
}

ul.sidenav ul {
   padding:0;
   margin:0;
   list-style:none;
   max-height:0;
   overflow:hidden;
   transition:max-height 2s cubic-bezier(0, 2, 0, 2);
}

ul.sidenav>li:hover>ul {
   max-height:1000px;
   transition:max-height 2s ease-in-out;
}

ul.sidenav ul li {
   line-height:21px
}

ul.sidenav ul li:first-child {
   margin-top:6px;
}

ul.sidenav ul li a {
   font-size:16px;
   line-height:16px;
   display:block;
   color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <ul id="menu-solutions-advisors" class="sidenav"> 
   <li id="menu-item-98"> <a href="#">Lorem ipsum<span class="arrow"></span> </a> 
    <ul class="sub-menu"> 
     <li id="menu-item-103"> <a href="#">Lorem</a> </li> 
     <li id="menu-item-101"> <a href="#">Lorem ips</a> </li> 
     <li id="menu-item-102"> <a href="#">Lorem ipsu</a> </li> 
    </ul> </li> 
   <li id="menu-item-108"> <a href="#">Lorem ipsu<span class="arrow"></span> </a> 
    <ul class="sub-menu"> 
     <li id="menu-item-109"> <a href="#">Lorem ip</a> </li> 
     <li id="menu-item-111"> <a href="#">Lorem ipsum dol</a> </li> 
     <li id="menu-item-110"> <a href="#">Lorem i</a> </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials