CodeLab
Tutorials For Everyone
Run
<!DOCTYPE html> <html> <head> <style> #container1, #container2 { display: flex; color: #333; justify-content: center; align-items: center; font-size: 20px; font-weight: bold; width: 120px; height: 100px; margin: auto; position: absolute; } #container1 { background: #f00; animation: anim1 5s infinite; clip: rect(0,100px,100px,0); } #container2 { background: #00f; animation: anim2 5s infinite; margin-top: 20px; clip: rect(0,100px,100px,0); margin-top: 110px; } @keyframes anim1 { 50% {clip: rect(0,50px,50px,0);} } @keyframes anim2 { 50% {clip: rect(0,20px,40px,0);} } </style> </head> <body> <h1>Animatable 'clip' Property</h1> <hr> <p>Experience the clip property behaviour.<p> <div id="container1">Container 1</div> <div id="container2">Container 2</div> </body> </html>