Dropdown & Dropup

Bootstrap Dropdowns

The bootstrap dropdown menu is used to create a toggleable menu. It provides users to choose one value from a predefined list. Before creating dropdown menu, we have to know about its class, that is given below:
  • The .dropdown class is used to indicate a dropdown menu.
  • The .dropwn-menu class is used to create dropdown menu.
  • The .dropdown-toggle and data-toggle="dropdown" class is used to open the dropdown menu.
Let us see an example of Bootstrap Dropdowns:
<div class="container">  
  <h2>Example of Dropdowns</h2>  
    <div class="dropdown">  
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example  
    <span class="caret"></span></button>  
    <ul class="dropdown-menu">  
      <li><a href="#">Bootstrap</a></li>  
      <li><a href="#">Material design</a></li>  
      <li><a href="#">Pure CSS</a></li>  
    </ul>  
  </div>  
</div>
Try Now

Bootstrap Dropdown Divider

The bootstrap dropdown divider is used to separate the links inside the dropdown menu with a thin horizontal border. Let us see an example of Bootstrap Dropdown Divider:
<div class="container">  
  <h2>Example of Dropdowns</h2>  
    <div class="dropdown">  
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example  
    <span class="caret"></span></button>  
    <ul class="dropdown-menu">  
      <li><a href="#">Bootstrap</a></li>  
      <li><a href="#">Material design</a></li>  
       <li class="divider"></li>  
      <li><a href="#">Pure CSS</a></li>  
    </ul>  
  </div>  
</div
Try Now

Bootstrap Dropdown Header

We can create dropdown header menu by using its class .dropdown-header. We can not select page header while using drowdown header menu. It is like a level that help to understand what is the work. Let us see an example of Bootstrap Dropdown Header:
<li class="dropdown-header">Dropdown header 1</li>
Try Now

Bootstrap Disable and Active Items

In bootstrap, we can disable and active items by using its .disabled class. Let us see an example of Bootstrap Disable and Active Items:
<li class="disabled"><a href="#">CSS</a></li>  
<li class="active"><a href="#">HTML</a></li
Try Now

Bootstrap Dropdown Position

We can add dropdown position using its class. To create right-align the dropdown, add the .dropdown-menu-right class. Let us see an example of Bootstrap Disable and Active Items:
<ul class="dropdown-menu dropdown-menu-right">

Bootstrap Dropup

In Bootstrap, we can create dropdup menu. All the dropdown menu will be show on the top of the menu. We have to change the <div> element with .dropdown class to .dropup. Let us see an example of Bootstrap Dropup:
<div class="dropup">
Try Now

Related Topics

Bootstrap Contact Us page

What is a “Contact Us” page? A “Contact Us” page is a web page available on the websites of various companies, organisations etc., for its users to contact the organisation or...

5 minutes read.

Bootstrap First Example

1) Add HTML5 doctype Before starting the example of Bootstrap, we should know about the some basic rules of Bootstrap. We have to add HTML5 doctype with lang element and CSS properties. <!DOCTYPE html>   <html lang="en">     <head>       <meta charset="utf-8">      </head>   </html> 2) Bootstrap...

2 minutes read.

Bootstrap List group

Bootstrap list group provides a group of a list of items. The most basic list is an unordered list. We can use <ul> element with .list-group class and <li> element with .lsit-group-item. Let us see...

3 minutes read.

Bootstrap 4 Colors

Bootstrap 4 Colors Bootstrap 4 consists of classes that are used to set colors according to the context of the element, and with the help of these classes, we can read...

2 minutes read.

Bootstrap Tables

We can create different types of responsive and awesome bootstrap table like: striped , border etc. Bootstrap Basic Table We can create a basic bootstrap table by using its class .table. It has...

3 minutes read.

Bootstrap 4 Tooltip

Bootstrap 4 Tooltip Tooltip Bootstrap 4 offers a tooltip component, a small popup box that appears when you move the cursor over an element such as buttons or any highlighted element. It...

3 minutes read.

Bootstrap 4 Layout

Containers Containers are the essential elements of the bootstrap layout. It is required when we are using a bootstrap grid system. Containers can also be nested, but most layouts do not need nested containers. Bootstrap has...

3 minutes read.

Bootstrap Pager

← Prev Next → ...

1 minute read.

Bootstrap 4 Form

Bootstrap 4 Forms Bootstrap 4 provides forms, which are one of the essential components for web pages and web applications. It is an input-based component, used to collect user data with the help of...

8 minutes read.

Bootstrap Navigation bar

Navigation Bars In Bootstrap, We can create navigation bar like a navigation header. It is placed at the top of the page. We can collapse or extend it according to screen...

3 minutes read.

Bootstrap 4 Carousel

Bootstrap 4 Carousel Bootstrap 4 offers a carousel component, which is also known as a slider or slideshow. The carousel is used for the dynamic representation of content using images with...

7 minutes read.

Bootstrap 4 Popover

Bootstrap 4 Popover Popover A popover is similar to the tooltip. The only difference between tooltip and Popover is that in the tooltip, the popup box appears when you move the cursor...

6 minutes read.

Text Shadows in CSS

Text shadows are created with the text-shadow CSS property. It takes a list of shadows separated by commas to be applied to the text and any of its styles. Each...

5 minutes read.

Bootstrap 4 Progress Bar

Bootstrap Progress Bar Bootstrap 4 offers progress bars that are used to represent the progress of tasks such as downloading a file, software installation, etc. on the computer. It represents the percentage of the...

9 minutes read.

Bootstrap 4 Utilities

Bootstrap 4 Utilities Bootstrap 4 utilities also known as helper classes that are used to add more style to the components. Utilities are used to make the website or webpage more stylish or elegant....

10 minutes read.

Bootstrap 4 Inputs

Bootstrap Inputs Bootstrap Form Inputs – Several pre-defined input types are available in HTML and Bootstrap. These input types help in styling the forms. When an input type is specified in the form, it means...

10 minutes read.

Dropdown & Dropup

Bootstrap Dropdowns The bootstrap dropdown menu is used to create a toggleable menu. It provides users to choose one value from a predefined list. Before creating dropdown menu, we have to know...

3 minutes read.

Bootstrap 4 Dropdowns

Bootstrap Dropdowns Bootstrap 4 provides a dropdown component, which is a toggle and contextual layout, used to display a predefined list of links. It allows the user to select a value from the dropdown...

15 minutes read.

Bootstrap 4 Scrollspy

Bootstrap 4 Scrollspy Bootstrap 4 offers a scrollspy component that is used to make the website more attractive and eye-catching. Basically, the scrollspy is used on the single-page website. The scrollspy highlights the nav...

5 minutes read.

Bootstrap 4 Alerts

Bootstrap 4 Alerts Bootstrap 4 offers alerts that are used to provide feedback messages on the user’s actions. There is no boundation of text length in the alerts. Alerts can be created...

1 minute read.