I am currently working with tooltips and I am looking to display the tooltip message upon clicking, rather than on hover.
Is there a way to make this modification?
This is the code I have so far:
.tooltip {
position: absolute;
top: 7px;
margin-left: 10px;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 570px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
<input type="text" maxlength="8" />
<a href="#" class="tooltip">
<img src="~/images/help-80.png" />
<span class="tooltiptext">
<img src="~/images/keyboard.png" /><br />
"This is the absolute maximum size of your item. Don't worry about different configurations here."
</span>
</a>
Currently, the message only appears when hovering over the icon. However, I would like it to be displayed on click and remain open.