.tooltip { position: relative; display: inline-block; border-bottom: 1px solid #8684d3; } .tooltip .tooltiptext { visibility: hidden; width: 250px; background-color: white; color: black; text-align: left; border-radius: 6px; padding: 15px; position: absolute; z-index: 1; bottom: 150%; left: 50%; margin-left: -60px; font-size: 0.8em; line-height: 1.5em; } .tooltip .tooltiptext::after { content: ""; position: absolute; top: 100%; left: 10%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: white transparent transparent transparent; } .tooltip:hover .tooltiptext { visibility: visible; }