Has anyone here added tooltips to font-awesome icons?
I have the following jsfiddle, but cannot seem to find a guide to add tooltips to the icons.
In regards to this question, this can be easily achieved using a few lines of SASS;
HTML:
CSS output would be:
a[data-tool-tip]{
position: relative;
text-decoration: none;
color: rgba(255,255,255,0.75);
}
a[data-tool-tip]::after{
content: attr(data-tool-tip);
display: block;
position: absolute;
background-color: dimgrey;
padding: 1em 3em;
color: white;
border-radius: 5px;
font-size: .5em;
bottom: 0;
left: -180%;
white-space: nowrap;
transform: scale(0);
transition:
transform ease-out 150ms,
bottom ease-out 150ms;
}
a[data-tool-tip]:hover::after{
transform: scale(1);
bottom: 200%;
}
Basically the attribute selector [data-tool-tip] selects the content of whatever's inside and allows you to animate it however you want.