A worked example, rendered from real sample data. Sign in to run the tool on your own input.
bg=#18181b color=#fafafa dir=top.tooltip { position: relative; display: inline-block; }
.tooltip::after {
content: attr(data-tip);
position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
margin-top: 8px;
background: #18181b; color: #fafafa;
padding: 6px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap;
opacity: 0; pointer-events: none; transition: opacity 150ms ease;
}
.tooltip:hover::after { opacity: 1; }
Build a pure-CSS tooltip from data-attr — top/bottom/left/right positions. Part of the DevTools Surf developer suite. Browse more tools in the CSS collection.