galaxy/Tooltips/elijahgummer_slimy-bobcat-84.html

45 lines
No EOL
1.1 KiB
HTML

<div class="tooltip-container">
<span class="tooltip">Uiverse.io</span>
<span class="text">Tooltip</span>
</div>
<style>
/* From Uiverse.io by elijahgummer - Tags: simple, tooltip, animation, blue, modern, transition */
.tooltip-container {
--background: #22d3ee;
position: relative;
background: var(--background);
cursor: pointer;
transition: background 0.3s;
font-size: 17px;
padding: 0.7em 1.8em;
}
.tooltip {
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%) translateY(-10%); /* Adjusted the initial position */
opacity: 0;
pointer-events: none;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
background: var(--background);
color: #fff;
border-radius: 0.3em;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
text-align: center;
font-size: 14px;
width: 120%; /* Adjusted the width */
padding: 0.5em 1em; /* Adjusted padding */
white-space: nowrap; /* Prevent text wrapping */
}
.tooltip-container:hover .tooltip {
top: -100%; /* Adjusted the tooltip position */
opacity: 1;
pointer-events: auto;
transform: translateX(-50%) translateY(0);
}
</style>