is it possible to have purely css (not javascript) this:
<ul>
<li>a</li>
<li>b</li>
</ul>
<div id="x" style="display:none;">c</div>
Display the <div> when I hover a <li>?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
lielements are in thatul, so#xis no longer reachable fromli:hover. So if you must have the hover effect only on thelielements, you’ll need JavaScript.If not, you could do this instead:
But the cursor can be anywhere on the
ulitself for#xto show up, rather than being directly on anyli, which isn’t quite what you want unless yourlis take up the entireularea.