CSS Animations
Creating Simple Animations CSS allows you to animate HTML elements using @keyframes.
<!DOCTYPE html>
<html>
<head>
<style>
@keyframes move {
0% { left: 0px; }
100% { left: 100px; }
}
.animated-box {
position: relative;
width: 50px;
height: 50px;
background-color: red;
animation: move 2s infinite alternate;
}
</style>
</head>
<body>
<div class="animated-box"></div>
</body>
</html>