<span data-tooltip="Hello"> CSS Tooltip </span>
span {
position: relative;
font-family: Inter;
}
span::after {
content: attr(data-tooltip);
position: absolute;
left: 50%;
top: calc(100% + 0.5rem);
padding: 0.5rem 0.75rem;
display: flex;
border-radius: 0.25rem;
color: #ffffff;
background-color: #181818;
white-space: nowrap;
transform: translateX(-50%);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.