I have a large block of text within a div. I am seeking a way to create a hover effect on specific words within the text, which will then display a div below the word containing a customized div. This functionality resembles the feature on Wikipedia where hovering over a link reveals a summary of the linked article.
Is there a method to achieve this using only CSS and without the use of JavaScript?
My attempt to add a div inside the span with relative positioning has resulted in unexpected issues. Refer to the code snippet below for a demonstration.
It is my understanding that Wikipedia utilizes JavaScript to achieve this effect.
.menu-hover:hover > div {
display: block
}
.menu {
position: relative;
top:20px;
display: none;
background: red;
}
<div>
<span>Blah blah...</span>
<span class="menu-hover">Menu
<div class="menu">menu items</div>
</span>
<span>Bluh bluh...</span>
</div>