Course Content
Bootstrap 5 Alerts
0/1
Progress Bars
0/1
Spinners
0/1
Pagination
0/1
List Groups
0/1
Bootstrap 5 Scrollspy
0/1
Bootstrap
About Lesson

Dropdown Alignment & Positioning

  • .dropdown-menu-end → Aligns the dropdown menu to the right
  • .dropdown-menu-start → Aligns the dropdown menu to the left
  • .dropdown-menu-sm-start, .dropdown-menu-md-end, etc. → Responsive alignment
HTML
<div class="dropdown">
    <button class="btn btn-info dropdown-toggle" type="button" data-bs-toggle="dropdown">
        Right Aligned Dropdown
    </button>
    <ul class="dropdown-menu dropdown-menu-end">
        <li><a class="dropdown-item" href="#">Option 1</a></li>
        <li><a class="dropdown-item" href="#">Option 2</a></li>
    </ul>
</div>

<br><br><br><br>

<div class="dropdown">
    <button class="btn btn-info dropdown-toggle" type="button" data-bs-toggle="dropdown">
      Left Aligned Dropdown
    </button>
    <ul class="dropdown-menu dropdown-menu-start">
      <li><a class="dropdown-item" href="#">Option 1</a></li>
      <li><a class="dropdown-item" href="#">Option 2</a></li>
    </ul>
</div>
</div>