<div style="padding: 100px; text-align: center;">
<button class="tooltip-container">
Hover Me
<span class="tooltip-text">This is a CSS-only tooltip!</span>
</button>
</div>.tooltip-container {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
position: relative;
display: inline-block;
padding: 10px 20px;
background: #2563eb;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
}
.tooltip-text {
visibility: hidden;
background-color: #1f2937;
color: #fff;
text-align: center;
padding: 8px 12px;
border-radius: 6px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: opacity 0.3s, bottom 0.3s;
width: 140px;
font-size: 0.85rem;
pointer-events: none;
}
.tooltip-text::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #1f2937 transparent transparent transparent;
}
.tooltip-container:hover .tooltip-text {
visibility: visible;
opacity: 1;
bottom: 140%;
}Nothing to show yetType HTML, CSS or JavaScript and your page appears here.
Click any element to find its code Esc
Check this code before you run it
It came from a shared link. It runs with fewer permissions, so it cannot open pop-ups, submit forms or start downloads.
0.00s / 0.00s
Nothing has animated yet. Hover, click or type in the preview and each CSS animation, transition or
element.animate() call shows up here as it plays.