HTML CSS examples for CSS Animatable Property:max-height
In the following code the max-height property of the div box is animating from its initial value "none" to "60px", and back to the initial value "none" again up to infinite times. The max-height property overrides the height property of the element.
-webkit- prefix is for Chrome, Safari, Opera.
-moz- prefix is for Firefox.
<!DOCTYPE html> <html lang="en"> <head> <title>Example of CSS max-height Property Animation</title> <style type="text/css"> .animated {<!-- ww w . jav a2 s . com--> width: 150px; height: 500px; padding: 40px 0; font: bold 50px sans-serif; text-align: center; background: #EEEEEE; border: 1px solid red; -webkit-animation: test 4s infinite; animation: test 4s infinite; } @-webkit-keyframes test { 50% {max-height: 60px;} } @keyframes test { 50% {max-height: 60px;} } </style> </head> <body> <p> </p> <div class="animated"> Box </div> </body> </html>