Hover-activated Dropdown Menus in Twitter Bootstrap
Many users prefer their Bootstrap menus to drop down upon hovering, eliminating the need for explicit clicks. This article addresses both the hover functionality and the removal of arrow icons next to menu titles.
Hover-activated Dropdown
To enable automatic dropdown on hover, utilize CSS to target the hidden menu option. Add the following code to your CSS:
ul.nav li.dropdown:hover > ul.dropdown-menu { display: block; }
For responsive designs, wrap the code in a media query:
@media (min-width: 979px) { ul.nav li.dropdown:hover > ul.dropdown-menu { display: block; } }
Removing the Arrow Icon
a.menu:after, .dropdown-toggle:after { content: none; }
By incorporating these CSS modifications, you can achieve hover-activated dropdown menus and eliminate arrow icons, enhancing the user experience and customizing your Bootstrap menus as desired.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3