I feel that the effect you mentioned can be achieved by writing ul:hover and li:hover. The parent node hover is similar to clearing the state of the child node, and the child node restores the hover state
For implementation details, please refer to Eric Meyer on CSS (Volume 2). The principle is actually the processing of hover mentioned on the first floor
In fact, the main problem is how to control the display and hiding of the first secondary menu that is displayed by default, right? You can add a coat nav to the entire first-level navigation ul and use its :hover to achieve display control. It's not convenient to write code when answering on mobile phone. I'll try it when I get up tomorrow morning.
After reading the answer above, just use the ul and li of the first-level navigation menu.
Probably like this
HTML:
CSS:
I feel that the effect you mentioned can be achieved by writing ul:hover and li:hover. The parent node hover is similar to clearing the state of the child node, and the child node restores the hover state
For implementation details, please refer to Eric Meyer on CSS (Volume 2). The principle is actually the processing of hover mentioned on the first floor
In fact, the main problem is how to control the display and hiding of the first secondary menu that is displayed by default, right? You can add a coat nav to the entire first-level navigation ul and use its :hover to achieve display control. It's not convenient to write code when answering on mobile phone. I'll try it when I get up tomorrow morning.
After reading the answer above, just use the ul and li of the first-level navigation menu.