If you don’t want to click on the parent menu item to display your submenu items in Customizr (which is the Twitter Bootstrap native way), use the following code :
(copy and paste it in custom CSS section or in a child theme style.css file)
/*make the menu sub-menu items drop down on mouse hover */ ul.nav li.dropdown:hover > ul.dropdown-menu{ display: block; margin: 0; }
Another interesting related snippet : Make the parent menu clickable
34 thoughts on “Sub-menu drop down on mouse hover”
Thank you very much – this helped!
Thank you it’s a great and simple solution
Thankyou so much…
my website dropdown menu hover is working… thankyou
thewellmedical.co.id
Hi Harimohan,
Our developer team handles support at https://wordpress.org/support/theme/customizr. Pose your question with a link to your site. Thanks.
I m facing one problem… sub-menu appears even without hovering over a menu . i.e. if i hover over the section that a menu can cover.. sub-menu appears itself without having to go the menu…
Thanks for this code!
Why don’t work for me?? 🙁
http://www.championstouch.it
Hi Marco, there’s an option in appareance > customize > header > navigation to do that. Did you already try it ?
Thanks
Thanks! You helped me, i was search for something exactly like this!
Congratulations.
Hi
I dont understand why on my computer subcategories dont drop down when you hoover over them and on other everything its working fine.
How is that possible ?
Thank you
Hi,
It could be a problem of browser cache not cleared
Superb, This is what I want
Thanks a lot.
Pari
I was dying to find it 🙂
thanx to share this valuable code…..
Thanks for this code!
hi, i am using speedy theme in word press, it did not allow me to have a dropdown menu on secondary navigation, i added some extra php code to functions php and header php and added some css, and made it work,
The only problem is, when i hover the on menu , it does not collapse smoothly , it pushes all the other containers down and it looks ugly ,i wonder how i can fix this? i would appreciate your response. Here is the link : http://www.aliyonabridal.com/blog
Thanks
Great advice! I changed my menu from pages, to categories. I’d like the subcategories to drop down when you hoover over them in the menu bar? Is that possible?
Thanks!!
Courtney
Hi Courtney, just set your subcategories as child of your parent category in the menu editor and you should be done!
More about menus => http://codex.wordpress.org/Appearance_Menus_Screen
Thanks
How do I associate a submenu to the main menu? From the menus page I can’t seem to find where I can assign the main menu-submenu relationship. Thank you!
Hi Shirley, please refer to this complete documentation online for menu creation : http://codex.wordpress.org/WordPress_Menu_User_Guide
Hope this will help you,
Best
Yay! I got it to work! Find the answer here! http://blog.kjodle.net/2011/08/25/how-to-create-and-use-custom-menus-in-wordpress/
Yes! If it would work like that on my page I would be happy! But I don´t know how to get the submenus to show up… It only shows the parent page when I change the theme to costumiz… Am I doing something wrong in the Menu section, maybe? I just chose wich parent-pages I want to show and added them to “menu 1”.
– Elin
I can´t see my submenus either. I am changing my theme on my webpage, and I really like this one, but of the 6 themes I tried this one is the only one where my submenus don´t show… – Elin
Hi Elin, this might work like in the demo site : http://demo.presscustomizr.com You might want to share a link of your website?
Hi Nikeo,
I’d like to use your snippet but I’ve got the problem that the secondary menu doesn’t show up in customizr. I tested with twenty fourteen and that works… Do you have any idea? I’m totally new to wordpress… 🙂
Hi Julia, since the recent updates of the theme, there’s an option in Customiz’it > Navigation which allows to switch between click and hover for the submenu opening.
Thanks
Thanks for your immediate answer!!
I’ve noticed this option but my problem is that the secondary menu doesn’t show up on either option. This considers only the customizr theme.
Do you have any suggestions?
Thanks, Julia
Works like a charm, thanks.
Yes, thank you Nikeo!
How do I get the submenu to actually drop below the parent menu item? When I hover the submenu either covers the parent item entirely or it appears way above the parent so you cant click on it? Please help!!
try using the z-index in the parent menu to send it to back or use it in the above to bring forward but you must have position in there as well either use relevant (which is relevant to everything around it) or absolute (regardless of everything else it will just fix it to that point you have specified based on margins etc)
ul.nav li.dropdown:hover > ul.dropdown-menu{
display: block;
position: relevant;
margin: 0;
z-index:0;
}
The z-index property specifies the stack order of an element, an element with greater stack order is always in front of an element with a lower stack order you can you use minus values as well.
Hi Nikeo,
It is what i want. But I prefer the parent menu does able to access to parent menu link. Because all my parent menu does a link for a page to land.
What should I do?
This is what I want..
thanks Nicolas 🙂
yeahh! Just what i need …. it runs perfectly.
I’m very happy with wordpress und customizr …
cu