I have a new problem with my menu.
I want to keep the parent hover effect active when mouse is over child.
I know I could maybe use jQuery? but I really wanna keep it in CSS if possible.
And without having to give all elements unique id’s…
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.
If you want to use a CSS only way, what I highly recommend to you, you would have to change your markup a little bit.
When you check for
:hoverona‘s parent (theli)awill still be on:hoverwhen you go down the submenu.Basically we’re doing this:
We will expand the
ato the dimensions of theli. So theliseems to behave like thea. The only difference is, that theliis the parent of theaand the submenuul.JSFiddle here.
HTML stays the same:
CSS changes: