Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
Sicherheitslücken (CVE)CVE-2026-82458 | Apache Thrift buffer overflow (EUVD-2026-91414)(02.10.2026 um 20:34 Uhr)
••
Sichere ProgrammierungWhy Time Series Databases Matter for Modern Enterprise Applications(02.10.2026 um 19:00 Uhr)
•
Sichere ProgrammierungWasm Inside Neo4j: Building the Example That Didn't Exist(02.10.2026 um 20:00 Uhr)
•••••
Sichere ProgrammierungHow to build a Byreal swap and liquidity workflow(02.10.2026 um 20:51 Uhr)
••
Sicherheitslücken (CVE)CVE-2026-82458 | Apache Thrift buffer overflow (EUVD-2026-91414)(02.10.2026 um 20:34 Uhr)
••
Sichere ProgrammierungWhy Time Series Databases Matter for Modern Enterprise Applications(02.10.2026 um 19:00 Uhr)
•
Sichere ProgrammierungWasm Inside Neo4j: Building the Example That Didn't Exist(02.10.2026 um 20:00 Uhr)
•••••
Sichere ProgrammierungHow to build a Byreal swap and liquidity workflow(02.10.2026 um 20:51 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

How to Make a Simple Bounce Animation with Just HTML and CSS

Ever wanted to add a little bounce to your UI without JavaScript? Let’s walk through how to do it with just HTML and CSS...no fuss, it's a walk in the park. In …

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Ever wanted to add a little bounce to your UI without JavaScript? Let’s walk through how to do it with just HTML and CSS...no fuss, it's a walk in the park.






In this tutorial, you'll learn how to create a smooth bounce animation for any element (text, button, image, etc.) using only HTML and CSS.






Let's jump right into it, shall we?






Steps






1. Start with a basic HTML structure



Let’s say we want to bounce a circle:

<div class="bounce"></div>









2. Style it with CSS



Give it some shape and bounce:

.bounce {

width: 100px;

height: 100px;

background: #00bfff;

border-radius: 50%;

position: relative;

animation: bounce 2s infinite;

}






3. Add the bounce animation



Now for the juicy part:



@keyframes bounce {
0%, 100% {
top: 0;
animation-timing-function: ease-in;
}

50% {
top: 100px;
animation-timing-function: ease-out;
}
}


You may be wondering how I arrived at the blocks of code in the @keyframes....worry no more, here's the breakdown:




  • 0% and 100%: Element is at the top.

  • 50%: Drops down (you can adjust the 150px for a higher or lower bounce).

  • ease-in and ease-out: Makes it feel more natural — fast drop, slow rise.



Here’s a quick demo on CodePen (you can plug this into your own HTML file too).



You can also view it in action in my Portfolio.






Bonus Tip



Now what's a tutorial without a bonus tip? I got you, worry less.

If you want the bounce to feel more dramatic, try adding scale or tweaking the duration, thus:



@keyframes bounce {
0%, 100% {
transform: scale(1);
}

50% {
transform: scale(1.3);
}
}





I'm curious to know if you've ever used CSS animations like this before. So if you've got cooler tricks, drop them in the comments. Or let me know what else you'd like to see next!






Thank you for reading! Follow me for more bite-sized tutorials like this.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Make a Simple Bounce Animation with Just HTML and CSS

Thematisch verwandte Begriffe: Make, Simple, Bounce, Animation · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag