Bouncing Arrow Icon

There is no more direct way to lead readers down a page than by telling them to scroll down. That’s what makes arrow icons so effective, and with this quick snippet you’ll be able to make them standout even more with a bounce.

To create a bouncing animation we’ll be using CSS keyframes. Animations are one of the coolest things about CSS as they allow us to bypass JavaScript to create simple effects.

However, for full browser support (CSS animations are still relatively new), the code to produce them can get repetitive to account for different browser prefixes.

Thankfully once we’ve created the animation we can apply a single HTML class to any element to make it bounce.

I rarely work with animations so if you see a way to simplify the code below I’d greatly appreciate you letting me know in the comments!

Add the Animation Styles into your style.css file

Like I said, the code is long! If you’d like, you can minify this long CSS once you’re done tweaking it so it takes up less space in your stylesheet.

You can adjust the range of motion (how far up/down the bounce goes) in the keyframes (make sure to use the same values across different keyframes) and increase/decrease the time it takes for the animation to play out in the bounce class (3s = 3 seconds).

It will take you a few edits before you understand how the values work, so don’t be afraid to experiment!

Once we have this CSS code saved to our site we can now make any element on our pages bounce with the .bounce class! Use wisely.

Make an Arrow Icon Bounce

You saw that bouncing arrow at the top of this post right? Here’s the HTML I pasted into the post editor to make it work (uses a default MD font icon). You can use this anywhere in WordPress that accepts HTML (widgets, menus, posts, custom templates, etc.):

<p class="bounce text-center"><i class="md-icon md-icon-angle-down large-title"></i></p>

I highlighted the .bounce class in the code above—again, that’s all it takes to make any element on your page bounce!