Código HTML
<span class="tooltip-container">
<img src="https://tutoriais.gustavocampelo.com.br/wp-content/uploads/2024/04/question-mark.png" alt="icone tooltip">
<span class="tooltip">Olá, isso é um tooltip!</span>
</span>
Código CSS
selector img {
filter: drop-shadow(8px 12px 12px rgba(0, 6, 58, 0.43));
}
.tooltip-container {
cursor: pointer;
position: relative;
display: inline-block;
width: 60px;
vertical-align: middle;
}
.tooltip {
opacity: 0;
z-index: 99;
color: #FFF;
width: 190px;
display: block;
font-size: 14px;
font-weight: 400;
line-height: 19px;
padding: 15px 20px;
border-radius: 8px;
text-align: center;
background: #4B5064;
transition: all .2s ease-in-out;
transform: scale(0);
position: absolute;
right: -65px;
bottom: 85px;
font-family: Sans-Serif;
}
.tooltip:before,.tooltip:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #4B5064;
position: absolute;
bottom: -10px;
left: 45%;
}
.tooltip-container:hover .tooltip {
opacity: 1;
transform: scale(1);
}