Animate CSS order property

To implement animation on order property with CSS, you can try to run the following code


Live Demo

<!DOCTYPE html>
         #demo1 {
            width: 600px;
            height: 180px;
            display: flex;
         #inner {
            animation: myanim 3s infinite;
         #demo1 div {
            width: 110px;
            height: 180px;
         @keyframes myanim {
            30% {
               order: 4;
      <h1>CSS order property</h1>
      <div id = "demo1">
         <div style = "background-color:yellow;order:1;" id = "inner"></div>
         <div style = "background-color:blue;order:2;"></div>
         <div style = "background-color:orange;order:3;"></div>
         <div style = "background-color:pink;order:4;"></div>
         <div style = "background-color:gray;order:5;"></div>
         <div style = "background-color:maroon;order:6;" id="inner"></div>

Updated on: 25-Jun-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started