Attr() en tekst-popup
.attri span
{
color: #1266f1;
border-bottom: 1px dashed;
position: relative;
cursor: pointer;
}
.attri span::after
{
content: attr(data-tooltip);
position: absolute;
top: -1.25em;
left: 50%;
transform: translateX(-50%);
color: #00b74a;
font-style: italic;
opacity: 0;
transition: 0.2s;
}
.attri span:hover::after {opacity: 1;}
echo "<p class='attri'>Some <span data-tooltip='tooltip'>text</span> here</p>";