HTML CSS examples for CSS Animatable Property:flex
All the individual columns properties i.e. flex-grow, flex-shrink and flex-basis are animatable in CSS.
-webkit- prefix is for Chrome, Safari, Opera.
-moz- prefix is for Firefox.
<!DOCTYPE html> <html lang="en"> <head> <title>Example of CSS3 flex Property Animation</title> <style type="text/css"> .flex-container {<!-- w w w . ja v a 2 s. c om--> width: 300px; height: 200px; font-size: 32px; border: 1px solid black; display: -webkit-flex; /* Safari */ display: flex; } .flex-container div { -webkit-flex: 1; /* Safari */ -ms-flex: 1; /* IE 10 */ flex: 1; } .item1 { background: #e84d51; } .item2 { background: #7ed636; } .animated { -webkit-animation: test 4s infinite; animation: test 4s infinite; } @-webkit-keyframes test { 50% {-webkit-flex: 3;} } @keyframes test { 50% {flex: 3;} } </style> </head> <body> <p> </p> <div class="flex-container"> <div class="item1"> 1 </div> <div class="item2 animated"> 2 </div> </div> </body> </html>