Site logo

Archived topic

How to fix Sub menu not showing when mouse is out of menu

12 replies · Started by SEO on July 29, 2021

Viewing posts 1–13 of 13

Hey guys, I want to add some margins on my submenus whenever I hover my mouse, this is the csss that I added. However upon adding this css whenever my mouse move towards the sub menu, the sub menu will go hide. here is my site

https://hrcstaging.wpengine.com/

.main-navigation:not(.toggled) ul li.sfHover>ul, .main-navigation:not(.toggled) ul li:hover>ul {
margin-top: 20px;
}

its not working

I just tested the code on your site in the developer tool, it's working.

After adding the code, have you cleared the cache?

this is the image of what I want to copy, I want to have a gap on my primary menu and sub menu
copy site

No I removed it

Can you add the CSS back in, leave it there, so we can take a look at whats happening.

I put back the css and it seems working. However when you hover on the submenus it is changing position. is there a solution for this?

Trt change this CSS

.main-navigation:not(.toggled) ul li.sfHover>ul, .main-navigation:not(.toggled) ul li:hover>ul {
    margin-top: 20px;
}

to this:

.main-navigation:not(.toggled) .main-nav > ul > li.sfHover>ul, .main-navigation:not(.toggled) .main-nav > ul > li:Hover>ul {
    margin-top: 20px;
}

Perfect thank you ying its working now the way it should be

Great! Glad to hear that :)

This archived topic is closed to new replies.