To animate a bouncing ball using CSS keyframes
Q. How to animate a bouncing ball using CSS keyframes?
<!DOCTYPE html>
<html>
<head>
<style>
.ball {
width: 50px;
height: 50px;
background-color: tomato;
border-radius: 50%;
position: relative;
animation: bounce 1s infinite ease-in-out;
}
@keyframes bounce {
0%, 100% { top: 0; }
50% { top: 100px; }
}
</style>
</head>
<body>
<div class="ball"></div>
</body>
</html>
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.
point.com