How to add custom animation on hover?
BOWWE tutorials
Welcome to our collection of online lessons. We’ve created these to help you learn the best practices and get the most out of BOWWE. Come back here whenever you want!

How to make custom animation on hover

A beautiful website is very important to make yourself be seen and to draw your viewers’ attention. A pleasant-looking website will encourage your potential clients to stay longer and just like dinosaurs from that one movie, the only thing that will speak to them is movement. So let’s make our website move.

Making animation using mouse:hover

There are a lot of different ways to make a website animate and we’ll go over a few of them starting from the easier ones. A hover is a state of widget elements that can be triggered by a mouse cursor hovering over them. We discussed this feature in a separate tutorial, here we are going to see an example on how we can apply this knowledge in our projects.

Hover state for your elements will encourage users to interact with the website, which will result in higher engagement on their part. Of course animating as many elements as possible would be ideal, but like with all things in life, too much can be overwhelming, so try to find that balance. 

 

When it comes to the hover there are a number of ways you can incorporate it to your project, for example changing the color of your buttons, underlining your links, or revealing hidden content on your pictures. Here we’ll try to make a tile highlight to improve your informational sections.

 

Let’s start by creating our first informational tile, which we’ll later copy multiple times. The content doesn’t matter, we’ll focus on animating the tile itself.

1
Drop a container. We will use an area widget.
2

Build content inside tailored towards your needs.

3
Style the container for basic state. We will use a minimal amount of styles for basic to later highlight the hover state. We’ll add paddings to separate content from the borders and round a little corners with border radius. These styles won’t be affected by our hover.
4
Next we’ll add a semi-transparent background which will be changed with hover.
5
To make it look nice we need a pleasant animation. Set the transition as ease_in_out and set the duration to 500ms (those values can be changed to satisfy your needs, but we recommend those as the most common set).
6
Now that we have our base we need to set the hover behavior. Set the hover state, or if you’re using selectors add the :hover state to your selector.
7
Now styling on hover. Change the background color to a darker shade, or fuller color. We will also add a transition by changing the scale to 104%.

Now when you hover over the element, it will react and change its styles, making your website more dynamic.

Note:

The hover can be activated with a mouse, but also on mobile devices with a finger tap, although this method is less effective, since mobile users need to already anticipate this animation and are less likely to activate it, unlike with mouse on desktops and laptops.
Congratulations!
Now you know how to apply hover state to elevate your website

Hours

Minutes

Seconds

3 years for less than 1 year

save up to

$723

Closing Symbol