html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
}

.tooltip {
    position: relative;
    display: inline-block;
    /* optional underline to hint it's hoverable */
    border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 50px; /*  your max width */
    white-space: normal; /* allow wrapping */
    word-break: break-word; /* break long words */
    background-color: black;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    /* Position the tooltip above the icon */
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
}