Agyan
adda
Run
Reset
Copy
CSS Tutorial › CSS Animations › Bounce and spinner
Back to tutorial
Code
Edit, then press Run or Ctrl+Enter
<style> @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-25px); } } @keyframes spin { to { transform: rotate(360deg); } } .ball { width: 50px; height: 50px; border-radius: 50%; background: tomato; margin: 30px; animation: bounce 1s ease-in-out infinite; } .spinner { width: 40px; height: 40px; border: 5px solid #ddd; border-top-color: #1f386b; border-radius: 50%; animation: spin .8s linear infinite; margin: 20px; } </style> <div class="ball"></div> <div class="spinner"></div>
Result