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

To present your team or simply yourself, this animation will allow you to display links to your social networks when hovering over the card: a striking effect guaranteed! Let’s discover how to achieve this together.

Image

 

Step 1

We are going to need to include Font Awesome 5. This library will allow us to add social network icons.

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

 

Step 2

The HTML code.

HTML
<div class="card">
  <div class="informations">
    <img src="https://cdn.vox-cdn.com/thumbor/nDW7YqKV8soKsZSfRorGXJLSH50=/1400x1400/filters:format(jpeg)/cdn.vox-cdn.com/uploads/chorus_asset/file/22147179/1229892934.jpg" alt="Elon Musk">
    <h1>Elon Musk</h1>
    <h2>Serial Entrepreneur</h2>
  </div>
  <div class="icon">
    <a href="#"><i class="fab fa-instagram fa-2x"></i></a>
    <a href="#"><i class="fab fa-github fa-2x"></i></a>
    <a href="#"><i class="fab fa-twitter fa-2x"></i></a>
  </div>
</div>

Thanks to the Font Awesome library we added in the first step, each class starting with “fa” will be retrieved and transformed into an icon.

The class fa-2x allows doubling the size of the icon.

You can find all available icons on fontawesome.com/icons.

 

Step 3

Let's style the "share" button.

CSS
.toggle {
  width: 50px;
  height: 50px;
  background: #c70039;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.toggle::before {
  content: '\f1e0';
  width: 100%;
  height: 100%;
  position: absolute;
  color: white;
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  text-align: center;
  line-height: 50px;
  font-size: 22px;
}

It is very important to add the font 'Font Awesome 5 Free' and specify that we want to use a bold font (font-weight) of 900.

 

Step 4

Let's now style the bullet list of our button.

CSS
.share.active .toggle::before {
  content: '\f00d';
  font-size: 2rem;
}
.share {
  position: fixed;
  bottom: 70px;
  right: 70px;
}
.share ol {
  position: absolute;
  width: 50px;
  height: 50px;
}

 

Step 5

Let's style each link.

CSS
.share ol li {
  position: absolute;
  width: 50px;
  height: 50px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all .3s;
  opacity: 0;
}

.share ol li a {
  color: black;
}

.share.active ol li {
  opacity: 1;
  transition: all .3s;
}

 

Step 6

Let’s shift each item a certain distance to make them appear from each side of our button.

CSS
.share.active ol li:nth-child(1) {
  transition-delay: .1s;
  transform: translateX(60px);
}

.share.active ol li:nth-child(2) {
  transition-delay: .2s;
  transform: translateY(60px);
}

.share.active ol li:nth-child(3) {
  transition-delay: .3s;
  transform: translateX(-60px);
}

.share.active ol li:nth-child(4) {
  transition-delay: .4s;
  transform: translateY(-60px);
}

 

Step 7

Let’s finish our share button by detecting the user's click to add or remove the active class.

JAVASCRIPT
const toggle = document.querySelector('.toggle');

toggle.addEventListener('click', () => {
  const shareBtn = document.querySelector('.share');
  shareBtn.classList.toggle('active');
});

When we click on the "share" button, we ask our browser to add the "active" class if it is present. Otherwise, we ask to remove it using toggle().

 

Want to Go Further

If you want to go further, for example, to position your button relative to other elements on your page, nothing is better than doing it with the incredible CSS Flexbox functionality.

Go take a look at our complete Flexbox guide to learn how to position your button.

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

Creating an animated list with CSS

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

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 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 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 gradient background on hover avec CSS

Whether it's to highlight a part of your website or a quote as in this example, generating and adding a gradient to the background can give your website a very modern touch. Find out in this article how to do it easily!

December 9, 2024

Create a menu that spans the entire page using CSS

From time to time we have to ask our visitors which page they want to go to, by displaying the main sections of our website. This menu is often not very pleasant to use, so let's find out together in this article how to make it much more modern, with beautiful animations that will make your passers-by want to visit your site!

December 9, 2024

Creating animated presentation cards with JavaScript

Whether you're presenting the team behind your project or anything else, using animated presentation cards will give your page a successful finishing touch. Find out how in this article!

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.