mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
85 lines
No EOL
1.6 KiB
HTML
85 lines
No EOL
1.6 KiB
HTML
<div class="tooltip">
|
|
<span>Hover me</span>
|
|
<div class="tooltip-text">
|
|
Ceci est un tooltip moderne et animé avec des bulles autour.
|
|
</div>
|
|
<div class="tooltip-bubble"></div>
|
|
<div class="tooltip-bubble"></div>
|
|
<div class="tooltip-bubble"></div>
|
|
</div>
|
|
|
|
<style>
|
|
/* From Uiverse.io by Sacha-PDV - Tags: simple, tooltip, circle */
|
|
.tooltip {
|
|
position: relative;
|
|
display: inline-block;
|
|
cursor: pointer;
|
|
}
|
|
.tooltip-text {
|
|
visibility: hidden;
|
|
width: 200px;
|
|
background-color: #3498db;
|
|
color: #fff;
|
|
text-align: center;
|
|
border-radius: 4px;
|
|
padding: 10px;
|
|
position: absolute;
|
|
z-index: 1;
|
|
top: -65px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
opacity: 0;
|
|
transition: opacity 0.3s, transform 0.3s;
|
|
}
|
|
.tooltip:hover .tooltip-text {
|
|
visibility: visible;
|
|
opacity: 1;
|
|
transform: translate(-50%, -60px);
|
|
}
|
|
.tooltip-text::after {
|
|
content: "";
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 50%;
|
|
margin-left: -5px;
|
|
border-width: 5px;
|
|
border-style: solid;
|
|
border-color: #3498db transparent transparent transparent;
|
|
}
|
|
.tooltip:hover .tooltip-bubble {
|
|
display: block;
|
|
}
|
|
.tooltip-bubble {
|
|
position: absolute;
|
|
width: 20px;
|
|
height: 20px;
|
|
background: #3498db;
|
|
border-radius: 50%;
|
|
display: none;
|
|
}
|
|
.tooltip-bubble:nth-child(3) {
|
|
bottom: 170px;
|
|
left: 43%;
|
|
}
|
|
.tooltip-bubble:nth-child(4) {
|
|
bottom: 170px;
|
|
left: 90%;
|
|
}
|
|
.tooltip-bubble:nth-child(5) {
|
|
bottom: 170px;
|
|
left: -10%;
|
|
}
|
|
.tooltip span {
|
|
display: inline-block;
|
|
padding: 5px 10px;
|
|
background: #3498db;
|
|
color: #fff;
|
|
border-radius: 4px;
|
|
transition: background 0.3s;
|
|
}
|
|
.tooltip:hover span {
|
|
background: #ff6b6b;
|
|
}
|
|
|
|
</style>
|
|
|