JSFiddle - React, Tailwind, and code Playground
HTML
<a data-text="Could use this text instead of title" title="1. ~~~~ List item (/br)~~~~
2. ~~~~ List item ~~~~
3. ~~~~ List item ~~~~
4. ~~~~ List item ~~~~
5. ~~~~ List item ~~~~ " class="tooltip">Hover over this text</a>
CSS
.tooltip{
display: inline;
position: relative;
}
.tooltip:hover:after{
background: #333;
background: rgba(0,0,0,.8);
border-radius: 0px 5px 5px 5px;
top: 15px;
color: #fff;
content: attr(title);
left: 100%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}
content: attr(title);
.tooltip:hover:before{
border: solid;
border-color: #333 transparent;
border-width: 6px 6px 0 6px;
bottom: 20px;
content: "";
left: 50%;
position: absolute;
z-index: 99;
}