Animate the "max-height" CSS property - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:max-width

Description

Animate the "max-height" CSS property

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Animating max-height to overcome height:auto limitation</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

div {<!--from   ww w  .ja va2s  .  c  o m-->
   max-height:1.2em;
   background:slategray;
   color:white;
   -moz-transition: 1s;
   -ms-transition: 1s;
   -o-transition: 1s;
   -webkit-transition: 1s;
   transition: 1s;
}
div:hover {
   max-height:999px;
}


      </style> 
 </head> 
 <body> 
  <div>
    Hover over me 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> foo bar 
   <br> 
  </div>  
 </body>
</html>

Related Tutorials