Bootstrap 5 Dropdowns Responsive alignment Last Updated : 29 Jul, 2024 Comments Improve Suggest changes Like Article Like Report Bootstrap 5 Dropdowns Responsive alignment is used to align dropdowns by using the responsive variation classes. We need to add a breakpoint-specific alignment class to make the dropdown alignment responsive.Dropdown Responsive alignment classdropdown-menu{-*}-end: To align the dropdown right with a given breakpoint. Here * can be replaced by sm, md,lg,xl, xxl.dropdown-menu{-*}-start: To align the dropdown left with a given breakpoint. Here * can be replaced by sm, md,lg,xl, xxl.Attribute Required:data-bs-display: To utilize responsive alignment, we need to disable dynamic positioning by setting this attribute to "static".Syntax: <ul class="dropdown-menu dropdown-menu-*-**"> <li>Content</li> </ul>* can be substituted with screen breakpoints like sm,md,lg etc** can be substituted with alignment options like end, startExample 1: In this example, The Dropdown menu will be aligned to the end on large screen, and left aligned when not on large screen HTML <!DOCTYPE html> <html> <head> <link href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity= "sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <script src= "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity= "sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"> </script> </head> <body> <div class="m-2"> <h1 class="text-success"> GeeksforGeeks </h1> <h3> Dropdown Menu Responsive Alignment</h3> <div class="btn-group"> <button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false"> GeeksforGeeks is a Computer Science Portal </button> <ul class="dropdown-menu dropdown-menu-lg-end"> <li> <button class="dropdown-item" type="button"> Java </button> </li> <li> <button class="dropdown-item" type="button"> Stack </button> </li> <li> <button class="dropdown-item" type="button"> Queue </button> </li> </ul> </div> </div> </body> </html> OutputExample 2: In this example, The Dropdown menu will be aligned to the end on a medium screen and left aligned on the small screen and large screen. HTML <!DOCTYPE html> <html> <head> <link href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity= "sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <script src= "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity= "sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"> </script> </head> <body> <div class="m-2"> <h1 class="text-success"> GeeksforGeeks </h1> <h3> Dropdown Menu Responsive Alignment</h3> <div class="btn-group"> <button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false"> GeeksforGeeks is a Computer Science Portal </button> <ul class="dropdown-menu dropdown-menu-md-end dropdown-menu-sm-start dropdown-menu-lg-start"> <li> <button class="dropdown-item" type="button"> Java </button> </li> <li> <button class="dropdown-item" type="button"> Stack </button> </li> <li> <button class="dropdown-item" type="button"> Queue </button> </li> </ul> </div> </div> </body> </html> OutputReferences: https://getbootstrap.com/docs/5.0/components/dropdowns/#responsive-alignment Comment More infoAdvertise with us 17bcs5e9h Follow Improve Article Tags : Technical Scripter Web Technologies Bootstrap Technical Scripter 2022 Bootstrap-5 +1 More Similar Reads Bootstrap 5 Dropdowns Single Button Bootstrap 5 Dropdowns Single button is used to turn a button into a dropdown toggle with some basic markup. A dropdown button lets the user select from a number of items. Bootstrap 5 Dropdowns Single Button class:dropdown-toggle: This class is used to make the button drop down.Syntax:<div class=" 2 min read Bootstrap 5 Dropdowns Split Button Bootstrap 5 Dropdowns split button is used to turn a button into a dropdown toggle with some basic markup. A dropdown button lets the user select from a number of items. Bootstrap 5  Dropdowns split button class:dropdown-toggle-split: This class is used for proper spacing around the dropdown caret i 3 min read Bootstrap 5 Dropdowns Sizing Bootstrap 5 Dropdowns Sizing is used to create dropdowns on different sizes of buttons. It normally works on any size of a button, there can be a single large button or a split small button. Bootstrap 5 Dropdowns Sizing Class: There is no pre-defined class for this you can use the Bootstrap 5 Dropdo 2 min read Bootstrap 5 Dropdowns Dark dropdowns Bootstrap 5 Dropdowns Dark dropdowns are needed to match the navbar or site theme. Add .dropdown-menu-dark to an existing .dropdown-menu to enable darker dropdowns to match a dark navbar or custom style. No changes are necessary for the dropdowns. Prerequisites: Refer to buttons and dropdowns for cu 2 min read Bootstrap 5 Dropdowns Directions Bootstrap 5 Dropdowns Directions are used to change the direction in which we want the dropdown to pop up. The arrow direction is changed based on the direction set for the dropdown to appear. Bootstrap 5 Dropdowns Directions: Dropdown Dropleft: This is used to show dropdown menus left-side of the r 2 min read Bootstrap 5 Dropdowns Dropup Bootstrap 5 Dropdowns Dropup is used to show dropdown menus above the parent elements by using the .dropup class.Bootstrap 5 Dropdowns Dropup Class:dropup: To launch dropdown menus above elements.Syntax:<div class="btn-group dropup"> ...</div>Example 1: This example describes the basic u 2 min read Bootstrap 5 Dropdowns Dropright Bootstrap 5 Dropdowns Dropright is used to open the dropdown on the right-hand side of the user, We can one the dropdowns anywhere Bootstrap 5 Dropdowns Dropright Class: dropend: This class is used to launch dropdown menus to the right of the button. Syntax <div class="btn-group dropend"> < 2 min read Bootstrap 5 Dropdowns Dropleft Bootstrap 5 Dropdowns Dropleft is used to open the dropdown on the left-hand side of the user. Dropdown menus can be set up to the left of the elements by adding .dropstart to the parent element. Bootstrap 5 Dropdowns Dropleft Class: dropstart: This class is used to launch dropdown menus to the righ 2 min read Bootstrap 5 Dropdowns Menu items Bootstrap 5 Dropdowns Menu items are a list of options on a website that appears only when a user interacts with the menu, like by clicking on it or hovering over it. Bootstrap 5  Dropdowns Menu items:Bootstrap 5 Dropdowns Menu items Active: It helps to set the state of any item in the dropdown menu 2 min read Bootstrap 5 Dropdowns Active Bootstrap5 Dropdowns Active helps to set the state of any item in the dropdown menu as active. By default, the active item's background color will be set to blue and the text color will be set to white to make it different from the surrounding items. Dropdowns Active Class: active: This class is use 2 min read Like