Home › Forums › Support › How to fix Sub menu not showing when mouse is out of menu This topic has 12 replies, 4 voices, and was last updated 4 years, 8 months ago by Ying. Viewing 13 posts - 1 through 13 (of 13 total) Author Posts July 29, 2021 at 10:28 am #1876138 SEO 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; } July 29, 2021 at 10:37 am #1876146 SEO here is what I want to accomplish in my sub menu gap https://www.harmonyrecoverync.com/ if you notice there is a slight gap on primary menu and sub menu July 29, 2021 at 10:41 am #1876151 LeoStaff Customer Support Hi there, Try this: https://generatepress.com/forums/topic/top-margin-on-sub-menu/#post-864184 July 29, 2021 at 12:13 pm #1876220 SEO its not working July 29, 2021 at 12:31 pm #1876237 YingStaff Customer Support I just tested the code on your site in the developer tool, it’s working. After adding the code, have you cleared the cache? July 29, 2021 at 12:43 pm #1876247 SEO this is the image of what I want to copy, I want to have a gap on my primary menu and sub menu July 29, 2021 at 1:32 pm #1876300 YingStaff Customer Support Have you added back the CSS you mentioned in your original topic? https://generatepress.com/forums/topic/how-to-fix-sub-menu-not-showing-when-mouse-is-out-of-menu/#post-1876138 July 30, 2021 at 6:47 am #1877062 SEO No I removed it July 30, 2021 at 10:14 am #1877528 DavidStaff Customer Support Can you add the CSS back in, leave it there, so we can take a look at whats happening. July 30, 2021 at 10:48 am #1877554 SEO 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? July 30, 2021 at 12:28 pm #1877645 YingStaff Customer Support 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; } July 30, 2021 at 12:48 pm #1877660 SEO Perfect thank you ying its working now the way it should be July 30, 2021 at 1:09 pm #1877691 YingStaff Customer Support Great! Glad to hear that 🙂 Author Posts Viewing 13 posts - 1 through 13 (of 13 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In