---
title: "Bouncing Ball Loader"
description: "HTML CSS to create a bouncing ball animation using keyframes"
url: "https://www.geekboots.com/css/bouncing-ball-loader"
markdown_url: "https://www.geekboots.com/css/bouncing-ball-loader/md"
category: "CSS"
author: "Geekboots"
published: "2022-08-09"
updated: "2026-11-30T16:38:26.976Z"
tags: ["CSS", "HTML", "Preloader", "Loading Animation", "Bouncing Ball"]
---

# Bouncing Ball Loader (CSS)

> HTML CSS to create a bouncing ball animation using keyframes

## Explanation



## Source Code

### bouncing-ball-loader.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bouncing Ball Loader</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body { background-color: #292929; }

        section {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100vh;
        }

        div.loader {
            width: 120px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        div.loader .dot {
            width: 25px;
            height: 25px;
            background-color: #f5dc00;
            border-radius: 100%;
            margin: 0 3px;
            animation: loading 1s linear infinite;
            animation-delay: calc(0.1s * var(--i));
        }

        @keyframes loading {
            0% {
                transform: translateY(-20px);
            }

            25%, 75% {
                transform: translateY(0);
            }

            100% {
                transform: translateY(-20px);
            }
        }
    </style>
</head>
<body>
    <section>
        <div class="loader">
            <span class="dot" style="--i:3"></span>
            <span class="dot" style="--i:2"></span>
            <span class="dot" style="--i:1"></span>
            <span class="dot" style="--i:0"></span>
        </div>
    </section>
</body>
</html>
```

## Companion Video

- [Watch on YouTube](https://www.youtube.com/watch?v=Osjz2Op1mXU)

## Related Code Examples

- [Understanding CSS Shadows: box-shadow vs drop-shadow](https://www.geekboots.com/css/understanding-css-shadows-box-shadow-vs-drop-shadow) ([Markdown](https://www.geekboots.com/css/understanding-css-shadows-box-shadow-vs-drop-shadow/md))
- [Attractive Mobile Responsive Navigation](https://www.geekboots.com/css/attractive-mobile-responsive-navigation) ([Markdown](https://www.geekboots.com/css/attractive-mobile-responsive-navigation/md))
- [Animated Bell Notification Icon](https://www.geekboots.com/css/animated-bell-notification-icon) ([Markdown](https://www.geekboots.com/css/animated-bell-notification-icon/md))
- [Cool Splash Image Effect in CSS](https://www.geekboots.com/css/cool-splash-image-effect-in-css) ([Markdown](https://www.geekboots.com/css/cool-splash-image-effect-in-css/md))
- [Edit Image with CSS filter](https://www.geekboots.com/css/edit-image-with-css-filter) ([Markdown](https://www.geekboots.com/css/edit-image-with-css-filter/md))
- [Menubar with Top Border Animations](https://www.geekboots.com/css/menubar-with-top-border-animations) ([Markdown](https://www.geekboots.com/css/menubar-with-top-border-animations/md))
- [Link Hover Animation](https://www.geekboots.com/css/link-hover-animation) ([Markdown](https://www.geekboots.com/css/link-hover-animation/md))
- [Menu Bar with Descriptive Menus](https://www.geekboots.com/css/menu-bar-with-descriptive-menus) ([Markdown](https://www.geekboots.com/css/menu-bar-with-descriptive-menus/md))

---
Source: [Geekboots](https://www.geekboots.com/css/bouncing-ball-loader)
