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; margin: auto; } #container1 { background: #f00; animation: anim1 5s infinite; } #container2 { background: #00f; animation: anim2 5s infinite; margin-top: 20px; } @keyframes anim1 { 50% {box-shadow: 0 0 30px 10px #0f0;} } @keyframes anim2 { 50% {box-shadow: 10px 10px 30px 5px #f00;} } </style> </head> <body> <h1>Animatable 'box-shadow' Property</h1> <hr> <p>Experience the changing size, color, and position of the shadow of the container using box-shadow property.<p> <div id="container1">Container 1</div> <div id="container2">Container 2</div> </body> </html>