JSFiddle - React, Tailwind, and code Playground
HTML
<div class="couponcode">First Link
<span class="coupontooltip">Content 1</span>
</div>
<div class="couponcode">Second Link
<span class="coupontooltip"> Content 2</span>
</div>
CSS
.couponcode:hover .coupontooltip {
display: block;
}
.coupontooltip {
display: none;
background: #C8C8C8;
margin-left: 28px;
padding: 10px;
position: absolute;
z-index: 1000;
width:200px;
height:100px;
}
.couponcode {
margin:100px;
}
JavaScript
var tooltip = document.querySelectorAll('.coupontooltip');
document.addEventListener('mousemove', fn, false);
function fn(e) {
for (var i=tooltip.length; i--;) {
tooltip[i].style.left = (e.pageX + 100) + 'px';
tooltip[i].style.top = (e.pageY - 50) + 'px';
}
}