CSS Menu on hover selector

130 views Asked by At

I am very close. How can I have MENU 1 on my .fiddle display as the default menu option then change when MENU 2 on hover?

Thank you in advance. Keep coding! :)

1

There are 1 answers

7
Todd J. On BEST ANSWER

To edit this entirely away from jquery based on your response do the following:

  1. Change #submenu1 from display:none; to display: block;
    This will Show your first menu by default.

  2. Add the following css section

    #a2:hover ~ #submenu1 { display: none; }

The ~ character selects #submenu1 when you hover over a2 element. Then it changes it to display:none;. Since you have code already to set submenu2 to display when you hover over a2, all this does is hide the submenu1 element.