In short, no (some work options are possible)
What your line does animation-count: infinte at the moment for an element: animation: ani1 3s 0s infinite, ani2 3s 9s infinite; . So, since the first declared animation has an infinite iteration counter, the second will never be reached
The easiest and most common way is to use javascript and animationEnd for this (I use the Craig Buckler PrefixedEvent function , but this is not required)
var elem = document.querySelectorAll("div")[0], pfx = ["webkit", "moz", "MS", "o", ""]; function PrefixedEvent(element, type, callback) { for (var p = 0; p < pfx.length; p++) { if (!pfx[p]) type = type.toLowerCase(); element.addEventListener(pfx[p]+type, callback, false); } } PrefixedEvent(elem, "animationend", function() { switchAnims(elem) }); function switchAnims(element) { if(element.style.animationName = "ani1") { element.style.animationName = "ani2"; } else { element.style.animationName = "ani1"; } }
(webkit only - add other prefixes)
Otherwise, for a clean CSS fix for now, you have to combine them as one animation. For you it will look like
@keyframes aniBoth { 0%, 16.666%, 33.333% { background: green; } 8.333%, 24.999%, 41.666% { background: red; } 50% { background: green; } 50.001% { background:white; width: 100px; } 75%, 100% { width: 100px; } 62.5%, 87.5% { width: 150px; } }
(webkit only - add other prefixes)