Hello there! I'm currently working on my very first HTML and CSS project, and one of the tasks involves aligning 4 icons side by side horizontally. The goal is to have the icons "grow" a bit when the mouse hovers over them. However, I've encountered an issue where the border grows on hover, causing the other icons to shift around due to maintaining margin space. I only want the icon that my cursor is hovering over to move. I've spent the past 3 hours searching for a solution with no luck so far. I hope that explanation was clear enough. Below is the code snippet from my HTML and CSS:
.icones {
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
border: solid #ffffff;
box-sizing: content-box;
height: 70px;
}
.icons a {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 28px;
margin: 10px;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5);
border: solid red;
}
.icons a:hover {
background: rgba(255, 255, 255, 0.02);
border-radius: 50%;
padding: 15px;
}
<div class="icones">
<div class="icons">
<a href="http://" target="_blank">
<ion-icon name="logo-github"></ion-icon>
</a>
<a href="http://" target="_blank">
<ion-icon name="logo-whatsapp"></ion-icon>
</a>
<a href="http://" target="_blank">
<ion-icon name="logo-instagram"></ion-icon>
</a>
<a href="http://" target="_blank">
<ion-icon name="logo-discord"></ion-icon>
</a>
</div>
</div>