Hover.css is a great little CSS library that adds hover effects to your HTML links and buttons. In this tutorial, we’ll bring you up to speed quickly on how to use hover.css.
You can load hover.css from a content delivery network (CDN) or download it directly from the hover.css website. Link it from a CDN like so:
If you want to have animated icons on your buttons, you’ll also need FontAwesome:
Making hover.css work
If you have a button like this…
I’m using Bootstrap to style my buttons here, but feel free to apply whatever styling you want.
… then apply a hover.css grow transition to it like this (move your cursor over the button to see the effect):
Adding icons to your buttons
As long as you’ve referenced FontAwesome, adding icons to your buttons is just like using any other hover.css effect:
You can use any icon you want here - not necessarily from FontAwesome - as long as you set the
hvr-icon on it.
In previous versions of hover.css, you could only use a set of predefined icons. This has now been improved.