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 Multiselect Dropdown

What is a multi-select Dropdown? Multi-select dropdown lists are used when we want to select multiple options for a particular record. Usually, dropdown lists provide the feature of choosing just one value...

4 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.

Environment Setup

How to use Bootstrap? We can use bootstrap in our project either by downloading or by providing link of the library files. 1) Download Bootstrap files To download files, visit official site of bootstrap www.getbootstrap.com/download/ and...

1 minute 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 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 4 List Groups

Bootstrap 4 List Groups Bootstrap 4 offers List Group component, which is used to display a series of content in an organized way. The most common list group is an unordered...

13 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.

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 Protocol (BOOTP)

In the following article, we will learn about the Bootstrap Protocol and how it maintains contracts among linked devices on webwork. What is Bootstrap Protocol? The Bootstrap Protocol is a webwork contract...

3 minutes read.

Difference between bootstrap.css and bootstrap-theme.css

The "bootstrap.css" uses to create a website with pre-existing designs and context. It uses basic Bootstrap classes like rows and columns with a CSS styling tool. The website is styled...

5 minutes read.

Bootstrap Images

Bootstrap 4 Images Bootstrap provides several classes for images to make them responsive and also helps to give some style to the images. Image Shapes Rounded Corners Bootstrap 4 offers .rounded class that makes the corners...

5 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 Wells

In Bootstrap, well are used to add a rounded border around an element. It is default some padding and gray background color. It is like a container that displays the content....

1 minute read.

Bootstrap 4 Media Objects

Bootstrap 4 Media Objects Bootstrap 4 offers a media object component that aligns the media objects and the content. The media object is used to create a repetitive and complex component...

7 minutes read.

CakePHP Layouts & Elements

A layout includes a presentation code that can be wrapped out in your view. It means that what you want to see in your view should be well-positioned in layout. When you create...

9 minutes read.

Bootstrap Toast Example

What are toasts? Toasts are similar to notifications, and they are lightweight and act as push notifications from mobile and desktop operating systems. They’re built using flexbox in Bootstrap. They can...

4 minutes read.

Bootstrap Grid System Example

Bootstrap Grid System Example Stacked to horizontal – In stacked to the horizontal grid system, the grid columns are stacked on top of each other on extra small devices and becomes...

7 minutes read.

Bootstrap Time Picker Example

What is a Bootstrap Time picker? It is used to display the time in hours, minutes and seconds from a dropdown menu. In this section, we will create an example to...

4 minutes read.

Bootstrap 4 navbar

A navigation navbar or navbar uses in every website to make it more user-friendly. Navigating through the website is easier, and the user can instantly search for the topic of...

8 minutes read.

Bootstrap Typography

Bootstrap provides simple and easily customized typography for headings, body text, lists, and many more. Headline <h1> to <h6> By default, Bootstrap has HTML headings (<h1> to <h6>) that are given below: Example <h1>h1. Bootstrap heading</h1>   <h2>h2. Bootstrap heading</h2>   <h3>h3. Bootstrap heading</h3>   <h4>h4. Bootstrap heading</h4>   <h5>h5. Bootstrap heading</h5>   <h6>h6. Bootstrap heading</h6> Try Now ←...

1 minute read.