Course Content
Bootstrap 5 Alerts
0/1
Progress Bars
0/1
Spinners
0/1
Pagination
0/1
List Groups
0/1
Bootstrap 5 Scrollspy
0/1
Bootstrap
About Lesson

Hover Dropdown & Dark Theme

  • .dropdown-menu-dark → Makes dropdown dark
  • .show → Used to manually show a dropdown
HTML
<style>
  .dropdown:hover .dropdown-menu {
    display: block;
  }
</style>

<div class="dropdown">
  <button class="btn btn-warning dropdown-toggle" type="button">
    Hover Dropdown
  </button>
  <ul class="dropdown-menu">
    <li><a class="dropdown-item" href="#">Option 1</a></li>
  </ul>
</div>
HTML
<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
    Dark Theme Dropdown
  </button>
  <ul class="dropdown-menu dropdown-menu-dark">
    <li><a class="dropdown-item" href="#">Dark Item 1</a></li>
  </ul>
</div>