<div class="ball"></div>
.ball {
  border-radius: 50%;
  width: 200px;
  height: 200px;
  background-color: pink;
  border: 2px solid #000;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from {
    margin-top: 0;
  }
  to {
    margin-top: -250px;
  }
}

body,
html {
  height: 100%;
}

body {
  display: flex;
  justify-content: center;
  margin-top: 250px;
  background-color: #D2F8D2; 
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.