JSFiddle - React, Tailwind, and code Playground
by Gwyn Milcote
HTML
hover box effects <span class='hoverable'>one<div class='hoverbox'>blaaa hhhhh hhhhh hhhhh hhhhh hhhh hhh hhhh hhhh hhh hhh hhh hhh hhhh hhhh hhh hhhh hhh hhhaa</div></span>
CSS
/* popups - when mouse over hoverable class, hoverbox div inside it appears */
.hoverable {
position: relative;
cursor: pointer;
color: green;
}
.hoverbox {
min-width: 100px;
width: 200px;
max-width: 500px;
position: absolute;
top: 160%;
left: 50%;
transform: translate(-50%, 0);
padding: 10px;
background: #fffaeb;
color: black;
border: 2px solid #e6bb70;
border-radius: 10px;
font-size: 14px;
z-index: 2;
box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
visibility: hidden;
opacity: 0;
transition: all 0.5s;
}
.hoverable:hover .hoverbox {
visibility: visible;
opacity: 1;
}
.hoverbox::after, .hoverbox::before {
bottom: 100%;
left: 50%;
border: solid transparent;
content: "";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.hoverbox::after {
border-color: rgba(255, 250, 235, 0);
border-bottom-color: #fffaeb;
border-width: 10px;
margin-left: -10px;
}
.hoverbox::before {
border-color: rgba(230, 187, 112, 0);
border-bottom-color: #e6bb70;
border-width: 13px;
margin-left: -13px;
}