CodeLab
Tutorials For Everyone
Run
<!DOCTYPE html> <html> <head> <style> #container1, #container2 { display: flex; justify-content: center; align-items: center; color: #fff; font-size: 20px; font-weight: bold; width: 120px; height: 100px; position: absolute; box-shadow: 0 0 10px 0 #aaa; } #container1 { background: #f00; bottom: 0; left: 0; animation: anim1 5s infinite; } #container2 { background: #00f; bottom: 400px; right: 0; animation: anim2 5s infinite; } @keyframes anim1 { 50% {bottom: 400px;} } @keyframes anim2 { 50% {bottom: 0px;} } </style> </head> <body> <h1>Animatable 'bottom' Property</h1> <hr> <p>Experience the changing position of the container using bottom property.<p> <div id="container1">Container 1</div> <div id="container2">Container 2</div> </body> </html>