How to make on-hover effect on Bootstrap’s navbar dropdowns

I can’t believe Bootstrap left this out on their documentation lol.

For those who still want to add “on-hover” effect on their Bootstrap’s navbar dropdown, with only on line of css, check out the css snippet below:

/* Adding an on-hover effect on Bootstrap navbar */
.dropdown:hover .dropdown-menu {
  display: block;
}

Checked and tested on Bootstrap 4.

Leave a comment

Your email address will not be published. Required fields are marked *