Components

Tooltip

Display informative text hovering and focusing on an element.

This is a tooltip
HTML
<div class="tooltip-container">
    <button class="outline">Hover me</button>
    <div class="tooltip">This is a tooltip</div>
</div>
                                
CSS
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    visibility: hidden;
    background-color: transparent;
    color: white;
    border: 0.5px solid gray;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;

    position: absolute;
    bottom: 120%;
    z-index: 1;

    opacity: 0;
    transition: opacity 0.5s;

    font-size: 0.8rem;
    font-weight: 300;
    width: 130px;
}

.tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
}