Wie erstelle ich einen springenden Ball mit CSS und HTML?

von Eric-Oliver Mächler | März 26, 2026 | Design | 0 Kommentare

Schlagwörter: CSS - CSS3 - HTML

Inhaltsverzeichnis

Heute zeige ich euch wie man so einen springenden Ball zeichnen und animieren kann.

Video

HTML

<div class="ball"></div>

CSS

:root {
  --bg: #b4838d;
  --ball: #f36725;
  --rand: #000;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.ball {
  position: relative;
  height: 100px;
  width: 100px;
  background-color: var(--ball);
  border-radius: 50%;
  border: 1px solid var(--rand);
  bottom: 30px;
  animation: springen 800ms infinite;
}

@keyframes springen {
  0% {
    bottom: 25px;
  }
  25%,
  75% {
    bottom: 35px;
  }
  50% {
    bottom: 40px;
  }
  100% {
    bottom: 20px;
  }
}

0 Kommentare

Kommentar Schreiben

Du kannst auf Fediverse-Profile verlinken, indem du fl:@benutzername in deinem Kommentar eingibst.

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert