Create a glitch effect on mouse-over with CSS

Add a modern glitch effect to your presentations or your logo, whether it's hovering or permanent! Let's find out how.
•
Updated on August 14, 2026
•
1 min read
Believemy logo
In this article

For your presentations or your logo, whether on hover or permanently, add a modern glitch/bug effect! Let’s discover together how to set it up.

 

Step 1

Let's start with the HTML code.

HTML
<i class="fab fa-instagram fa-4x"></i>

And in the head tag:

HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" />

We will use Font Awesome to display an icon without the hassle of searching for an image.

Step 2

Let's style the icon and the hover effect.

CSS
.fab {
  color: white;
}

.fab:hover {
  animation: icon-glitch 1s infinite;
}

On hover, we call an “icon-glitch” animation. Just call it to apply this effect to all elements.

Step 3

Let's create the icon-glitch animation to complete the project.

CSS
@keyframes icon-glitch {
  0% {
    text-shadow: 5px 4px rgb(244, 67, 54), -5px -6px rgb(33, 150, 243);
  }
  25% {
    text-shadow: -5px -6px rgb(244, 67, 54), 5px 4px rgb(33, 150, 243);
  }
  50% {
    text-shadow: 5px 4px rgb(244, 67, 54), -8px 4px rgb(33, 150, 243);
  }
  75% {
    text-shadow: -8px -4px rgb(244, 67, 54), -5px -4px rgb(33, 150, 243);
  }
  100% {
    text-shadow: -5px 0 rgb(244, 67, 54), 5px -4px rgb(33, 150, 243);
  }
}
Category: Developers

Share this article

Want to help us? Share this article on your networks or even better: on your site, in an article or in your newsletter.

Believemy logo
Comments (0)

You need to be logged in to comment on this article: log in or sign up.

Read next

Create a very modern hover on a link

Here's an easy way to create a very modern hover on a link! There are lots of possible effects for buttons and links: the better they look, the more likely your users will be to click on them.

December 9, 2024

Create an animated "rainbow" button with CSS

In this article, we'll show you how to create a rainbow button that comes to life when the mouse hovers over it. A modern and sensational effect guaranteed!

December 9, 2024

Create hover text on image with CSS

We've already seen how to create an element that is displayed when the mouse hovers over an image, but in this article we'll show you how to display a whole host of information very fluidly by hovering the mouse over an element!

December 9, 2024

Create a map displaying links on mouse-over with CSS

To present your team or simply yourself, this animation will allow you to display the links to your social networks when you hover over the map: a striking effect guaranteed! Let's find out how to do it together.

December 9, 2024

Creating circled buttons on hover with HTML and CSS

For a menu or to encourage your readers to share your website, share buttons are essential elements to add to your website. Let's find out how to make them more modern with a "neon" effect that will surround the icon selected by your user.

December 9, 2024

Create an animated 3D button using CSS

In this article, we'll find out how to create a three-dimensional button that will add a touch of softness and perspective to your projects!

December 9, 2024

Make an arrow that expands when hovered over with CSS

Whether it's to make your users want to see your project, read your article or access a page on your website, presenting your link with an arrow will make it easier to catch your visitors' eye! Let's find out in this article how to animate this arrow to enhance your readers' experience.

December 9, 2024

Creating an animated list with CSS

Let's find out how to create an animated hover list!

December 9, 2024

Become the solopreneur you dream of being.

First project, career change, business launch: access our courses, practice on real-world cases, and move forward with clear guidance.