CodeLab
Tutorials For Everyone
Run
<!DOCTYPE html> <html> <head> <style> #grid-container { display: grid; grid-template-columns: auto auto auto auto auto auto auto auto auto; background: #333; grid-gap: 5px; padding: 20px; box-shadow: 0 0 10px 0 #aaa; border-radius: 20px; } #grid-container div { width: 30px; height: 30px; text-align: center; line-height: 30px; font-size: 20px; background: red; border-radius: 50px; } #item1 {animation: anim 3s infinite; background: #ff0 !important; order: 1;} #item2 {order:2;} #item3 {order:3;} #item4 {order:4;} #item5 {order:5;} #item6 {order:6;} #item7 {order:7;} #item8 {order:8;} #item9 {order:9;} @keyframes anim { 50% {order: 10;} } </style> </head> <body> <h1>Animatable 'order' Property</h1> <hr> <p>Experience the changing order of the item1 from position 1 to 9 and then back to position 1.</p> <div id="grid-container"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> <div id="item7">7</div> <div id="item8">8</div> <div id="item9">9</div> </div> </body> </html>