I need help with displaying tooltips only when hovering over anchor tags. Initially, I have hidden the visibility and want to show it on hover. However, the tooltips are not appearing when I hover over them and there are no console errors displayed. Can someone please assist me?
body {
font-family: Bogle, Bogle, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
margin: auto;
width: 80%;
background-color: #F9F9F9;
padding: 10px;
border-radius: 12px;
}
.links {
display: flex;
justify-content: center;
}
p {
text-align: center;
font-size: 18px;
}
a {
text-align: center;
}
.spanhead1 {
margin-right: 15px;
margin-left: 10px;
font-size: 14px;
margin-top: 20px;
width: 69px;
word-break: break-all;
}
.spanhead2 {
margin-right: 15px;
margin-left: 10px;
font-size: 14px;
margin-top: 20px;
width: 48px;
word-break: break-all;
}
.heading {
font-weight: bold;
font-size: 20px;
}
.spanhead1 .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #e1edf9;
color: #000;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
top: 150%;
left: 50%;
margin-left: -60px;
font-size: 16px;
}
.spanhead1 .tooltiptext::after {
content: "";
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent #e1edf9 transparent;
}
.spanhead1:hover .tooltiptext {
visibility: visible;
}
.spanhead2 .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #e1edf9;
color: #000;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
top: 150%;
left: 50%;
margin-left: -60px;
font-size: 16px;
}
.spanhead2 .tooltiptext::after {
content: "";
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent #e1edf9 transparent;
}
.spanhead2:hover .tooltiptext {
visibility: visible;
}
<div>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>xcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<div class="links">
<span class="spanhead1">
<a href="javascript:void()" onclick="winperson_folowup()" style="color: rgb(0,113,206);">Open Door (ODP-)</a>
<span class="tooltiptext">For opendoor</span>
</span>
<span class="spanhead2">
<a href="https://xyz" target="_blank" style="color: rgb(0,113,206);">Ethics (IIMT-)</a>
<span class="tooltiptext">For Inperson</span>
</span>
</div>
</div>