in CSS
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#test {
height: 1em;
background: red;
-webkit-animation: test 6s ease -3s infinite;
}
@-webkit-keyframes test {
from { width:0%;}
50%{width:100%;}
to {width: 0%;}
}
</style>
</head>
<body>
<div id="test"></div>
</body>
</html>