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.
•
Updated on August 14, 2026
•
2 min read
Believemy logo

Here's how to easily create a very modern hover effect on a link! There are many possible effects on buttons and links: the more successful they are, the more your users will want to click on them.

You can find the entire tutorial on our Instagram account.

 

Step 1

Let's start with the HTML code.

HTML
<a href="#">Read the Article</a>

So simple that we can skip the explanations. You can also use a class instead of directly selecting the a tag.

 

Step 2

Now we need to style our link to start giving it some style.

CSS
a {
  text-decoration: none;
  color: black;
  font-size: 1.4em;
  position: relative;
  padding: 0 15px;
  transition: .2s all;
  font-weight: 300;
}

 

Step 3

Let's add a small border before the text, using the ::before selector, which allows us to apply various properties to a space that is located before the element.

CSS
a::before {
  content: '';
  position: absolute;
  background: #4cd3c2;
  width: 2px;
  height: 100%;
  left: 0;
  transition: .2s all;
  z-index: -1;
}

By using the content property, we enable the display of the border, because otherwise the browser will display nothing, as the element is empty.

We then define the border with position absolute. Thanks to the position relative set on the link (a), the border will adapt to the link and not to the page.

Finally, we give it a z-index of -1 so that the border is hidden beneath the text in the next step.

 

Step 4

Let's make it dynamic!

CSS
a:hover::before {
  width: 100%;
}
a:hover {
  color: #ffffff;
  font-size: 1.6em;
}
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

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 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.

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 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

Creating a hovered with CSS

In this tutorial we'll look at how to create an overlay easily using CSS!

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 an animated list with CSS

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

December 9, 2024

Create a heartbeat button

For a main button or even for a button you want to highlight, offering this heartbeat effect can give your website a very modern feel. Find out how in this article.

December 6, 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.