I noticed that the following code works as expected in desktop PC, but not in mobile devices:
html
<span class="tooltip"><span class="tooltiptext">text visible on mouse over</span>visible text</span>
css
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
text-indent: 0px !important;
}
.tooltip .tooltiptext {
visibility: hidden;
/* width: 160%; */
text-align: justify;
font-size: 80%;
background-color: white;
color: black;
border-radius: var(--rounded);
padding: 10px;
position: absolute;
z-index: 1000;
bottom: 100%;
left: 0;
/* margin-left: -60px; */
margin-bottom: 3%;
opacity: 0;
/* transition: opacity 0.7s; */
box-shadow: gray -3px 3px 4px;
}
.tooltiptext {
min-width: 20vw}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 10%;
margin-left: -5px;
border-width: 12px;
border-style: solid;
border-color: white transparent transparent transparent;
}
.tooltip .tooltiptext {
transform:translateY(10%);
transition:visibility 0.1s, opacity 0.2s linear, transform 0.2s linear;
}
.tooltip:hover .tooltiptext {
transform:translateY(0%);
}
How fix the mobile problem?
Thank you!