<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
<div class="container flex">
<h3>Filtres</h3>
<div class="flex icons">
<i class="fa-solid fa-globe fa-lg"></i>
<div>Pays</div>
</div>
<div class="flex icons">
<i class="fa-solid fa-house fa-lg"></i>
<div>Maison</div>
</div>
<div class="flex icons">
<i class="fa-solid fa-building fa-lg"></i>
<div>Appartement</div>
</div>
</div>
:root {
--white: #fff;
--orange: #f26440;
--grey: #f2f2f2;
--black: #000;
}
.container {
width: 90%;
margin: 2rem auto;
}
.flex {
display: flex;
justify-content: center;
align-items: center;
gap: 3rem;
}
.icons {
padding: 1rem;
height: 50px;
border: 2px solid var(--grey);
border-radius: 100px;
}
.icons i {
display: inline-block;
height: 45px;
aspect-ratio: 1/1;
color: var(--white);
line-height: 45px;
text-align: center;
border: 1px solid var(--orange);
background-color: var(--orange);
border-radius: 50%;
}
.icons:hover {
background-color: var(--grey);
color: var(--black);
}
.icons:hover i {
background-color: var(--white);
color: var(--orange);
}
/*
https://www.sitepoint.com/community/t/icon-not-centered/453254/2
*/
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.