Car Code
Car Code
<div class="road-at-night">
<div class="road"></div>
<div class="car">
<div class="wheel wheel-1"></div>
<div class="wheel wheel-2"></div>
</div>
</div>
CSS
.road-at-night {
background-image: url(https://example.com/night-
sky.jpg);
background-size: cover;
height: 100vh;
position: relative;
}
.road {
background-image: url(https://example.com/road.png);
background-size: cover;
height: 100px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.car {
background-image: url(https://example.com/car.png);
background-size: cover;
height: 50px;
position: absolute;
bottom: 100px;
left: 50%;
transform: translateX(-50%);
width: 100px;
}
.wheel {
background-image:
url(https://example.com/wheel.png);
background-size: cover;
border-radius: 50%;
height: 25px;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%) rotate(0deg);
width: 25px;
animation: rotation 1s linear infinite;
}
.wheel-1 {
left: 25px;
animation-delay: 0.2s;
}
.wheel-2 {
left: -25px;
animation-delay: 0.4s;
}
@keyframes rotation {
0% {
transform: translateX(-50%) rotate