Skip to content

Instantly share code, notes, and snippets.

@dileshni
Created July 11, 2015 20:20
Show Gist options
  • Save dileshni/092d5f2262a30d5f9916 to your computer and use it in GitHub Desktop.
Save dileshni/092d5f2262a30d5f9916 to your computer and use it in GitHub Desktop.
NqMWbq
<div class="box_animation"></div>
<p>This box will animate for 4 seconds and go back to the original color.</p>
<p><strong>Remember: animation-duration property is required for this to work</strong></p>
.box_animation {
width: 100px;
height: 100px;
background-color: red;
-webkit-animation-name: example; /* Chrome, Safari, Opera */
-webkit-animation-duration: 4s; /* Chrome, Safari, Opera */
animation-name: example;
animation-duration: 4s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
/* Standard syntax */
@keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment