mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-27 20:50:21 +08:00
52 lines
No EOL
973 B
HTML
52 lines
No EOL
973 B
HTML
<div class="tooltip">
|
|
Hover me
|
|
<div class="tooltiptext">Hi there !</div>
|
|
</div>
|
|
|
|
<style>
|
|
/* From Uiverse.io by G4b413l - Tags: tooltip, button, button hover effect */
|
|
.tooltip {
|
|
position: relative;
|
|
display: inline-block;
|
|
cursor: pointer;
|
|
background-color: #282828;
|
|
color: #f1f1f1;
|
|
padding: 1em 3em;
|
|
border-radius: 1em;
|
|
}
|
|
|
|
.tooltip .tooltiptext {
|
|
visibility: hidden;
|
|
width: 200px;
|
|
background-color: #28282817;
|
|
color: #282828;
|
|
text-align: center;
|
|
border-radius: 5px;
|
|
padding: 10px;
|
|
position: absolute;
|
|
z-index: 1;
|
|
bottom: 125%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
opacity: 0;
|
|
transition: opacity 0.3s;
|
|
}
|
|
|
|
.tooltip:hover .tooltiptext {
|
|
visibility: visible;
|
|
opacity: 1;
|
|
}
|
|
|
|
.tooltip .tooltiptext::after {
|
|
content: "";
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 50%;
|
|
border-width: 8px;
|
|
border-style: solid;
|
|
border-color: #28282817 transparent transparent transparent;
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
</style>
|
|
|