Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS margin-bottom Property Animation</title> <style> .animated { padding: 40px 0; font: bold 46px sans-serif; text-align: center; background: #a8bddb; border: 1px solid #6a8dc1; -webkit-animation: test 4s infinite; /* Chrome, Safari, Opera */ animation: test 4s infinite; } /* Chrome, Safari, Opera */ @-webkit-keyframes test { 50% {margin-bottom: 100px;} } /* Standard syntax */ @keyframes test { 50% {margin-bottom: 100px;} } </style> </head> <body> <div class="animated">Box</div> <p><strong>Warning:</strong> CSS Animations do not work in Internet Explorer 9 and earlier versions.</p> <p><strong>Note:</strong> The margin-bottom property of the following DIV box is animating from its initial value "0" to "100px", and back to the initial value "0" again up to infinite times.<p> </body> </html>