Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS max-height Property Animation</title> <style> .animated { width: 150px; height: 500px; padding: 40px 0; font: bold 46px sans-serif; text-align: center; background: #aaccaa; border: 1px solid #63a063; -webkit-animation: test 4s infinite; /* Chrome, Safari, Opera */ animation: test 4s infinite; } /* Chrome, Safari, Opera */ @-webkit-keyframes test { 50% {max-height: 60px;} } /* Standard syntax */ @keyframes test { 50% {max-height: 60px;} } </style> </head> <body> <p><strong>Warning:</strong> CSS Animations do not work in Internet Explorer 9 and earlier versions. The max-height property doesn't animate smoothly like other animatable property.</p> <p><strong>Note:</strong> The max-height property of the following 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.<p> <div class="animated">Box</div> </body> </html>