From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use dropdowns

Use dropdowns - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Use dropdowns

- [Instructor] Dropdowns are a common design patterns in Bootstrap. You can create them easily for different components, so let's take a look. You can use dropdown in a bunch of different components including navs, tabs, and buttons. If you've been following along, you've already seen how to work them into navbars which is also how you implement them in navs. You create dropdowns in two parts. First, you create a button to trigger the dropdown and then create the menu itself. They're tied under our dropdown container that toggles the dropdown menu. For the menu, you can either use anchor tag links or buttons. The classes for a basic dropdown are the dropdown class on the container of both the trigger and the menu element, the dropdown-toggle class on the button that triggers the menu, and then the dropdown-menu class which is the container for the menu. You also add a dropdown-item on each individual menu item which is either a link or a button. Inside the dropdown, you can add a few…

Contents