Hover opacity transition on child - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Animation

Description

Hover opacity transition on child

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">
nav ul {<!--from  w w  w  .  java 2s .com-->
   position:relative;
   width:65px;
   margin:351px 0 0 0;
   padding:0;
   background:Chartreuse;
   list-style:none;
}

nav img {
   float:left width:65px;
   height:65px;
}

nav a {
   float:left;
}

nav ul li {
   float:left;
   background-color:yellow;
}

nav ul li:hover>ul {
   visibility:visible;
   opacity:2;
}

nav ul ul {
   visibility:hidden;
   display:block;
   position:absolute;
   opacity:0;
   width:301px;
   height:201px;
   bottom:100%;
   transition:opacity 2s linear, visibility 2s linear;
}
</style> 
 </head> 
 <body> 
  <nav> 
   <ul> 
    <li id="menu"> <a> <img src="https://www.java2s.com/style/demo/Opera.png">Lorem ipsu</a> 
     <ul> 
      <li> <h1>Lorem ipsum</h1> <h2>Lorem ipsum dolor sit amet, consectetur </h2> </li> 
     </ul> </li> 
   </ul> 
  </nav>  
 </body>
</html>

Related Tutorials