A quick overview of CSS animation and keyframe properties.
CSS animations
Complex keyframe-based animations that can autoplay
@keyframes
animation
@keyframes rainbow-y-fade-y-thing-y { 0% { background-color: red; } 50% { background-color: orange; } 100% { background-color: yellow; } }
.box { animation: rainbow-y-fade-y-thing-y 2s linear; }
<div class="purple"></div>
.purple { transform-origin: right bottom; animation: spin 1s infinite alternate; } @keyframes spin { /* Markbot won’t like this spacing; */ /* it’s compressed to fit on the screen */ 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }