JSFiddle - React, Tailwind, and code Playground
by rrtx2000
HTML
<title>Show help text when hovering using CSS</title>
<body>
<div>This shows a popup window using CSS when you mouse over an image.
<div>Hover over the question mark for a popup help window. <span id="help">
<img src="questionmark.png" alt="[?]"/>
<span id="help_popup">
This is the normally hidden help text.
<br/>It only shows up when you hover over the question mark.
</span>
</span>
</div>
</div>
</body>
CSS
#help:hover #help_popup {
/*If you hover over the help icon, show the help_popup span*/
display: block;
}
#help {
position: relative;
}
#help_popup {
/*Normally, hide this span*/
display: none;
position: absolute;
width: 15em;
padding: 10px;
background: #CFF;
color: #000;
border: 3px solid;
text-align: center;
left: 10px;
/*this is still needed even if it's 0*/
}