Search code examples
htmlcsspopover

How do I hover over span to let a div appear?


 #hello{
   font-size: 4em;
 }
 div.about{
   display: none;
 }
 #hello:hover  div.about {
   display: block;
 }



<pre id="hometext"><span id="hello">Hello!</span></pre>
<div class="about" id="about"><p>hello</p></div>

First of all, I am new to stackoverflow. Secondly, I want to over a specific part of a paragraph, the span, and then let this div appear. But it doesnt seem to work..


Solution

  • You dont have to use javascript:

    #hometext:hover + #about { display:none; }