Bootstrap Dropdown

Learn how to create a Dropdown Menu in Bootstrap. With that learn the following in this lesson:

  • Add header in Dropdown Menu
  • Disable a dropdown menu item
  • Separate links in a Dropdown Menu
  • Create a Dropright menu
  • Create a Dropleft menu
  • Align the dropdown menu to the right

Example – Bootstrap Dropdown

Let us now see an example to create a dropdown menu in Bootstrap:

<!DOCTYPE html>
<html lang="en">
   <head>
      <title>Bootstrap Dropdown Menu Example</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
      <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
   </head>
   <body>
      <div class="container">
         <div class="dropdown">
            <button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">
            Java
            </button>
            <div class="dropdown-menu">
               <a class="dropdown-item" href="#">Core Java</a>
               <a class="dropdown-item" href="#">Advanced Java</a>
            </div>
         </div>
      </div>
   </body>
</html>

Output

Bootstrap Dropdown Example

Click the dropdown menu:

Bootstrap Dropdown Example

Video Tutorial – Bootstrap Dropdown

The following is the complete video tutorial to learn how to work with Dropdown in Bootstrap:


If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


Read More:

Bootstrap Collapse
Bootstrap Forms
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment