A dropdown menu is a toggleable menu that shows a list of links or actions when clicked. It helps organize navigation or options in a small space.
Click to reveal answer
beginner
How do you align a dropdown menu to the right in Bootstrap?
Add the class dropdown-menu-end to the dropdown menu element. This moves the menu to align its right edge with the toggle button.
Click to reveal answer
beginner
What class aligns a dropdown menu to the left in Bootstrap?
By default, dropdown menus align to the left. You can use dropdown-menu-start to explicitly align the menu to the left side.
Click to reveal answer
intermediate
How can you align a dropdown menu to the center in Bootstrap?
Bootstrap does not have a built-in class for center alignment of dropdown menus. You can use custom CSS with <code>left: 50%</code> and <code>transform: translateX(-50%)</code> on the dropdown menu to center it.
Click to reveal answer
intermediate
Why is dropdown menu alignment important for accessibility?
Proper alignment ensures the menu appears where users expect it, making navigation easier. It also helps keyboard users and screen readers by keeping a logical flow.
Click to reveal answer
Which Bootstrap class aligns a dropdown menu to the right?
Adropdown-menu-left
Bdropdown-menu-right
Cdropdown-menu-center
Ddropdown-menu-end
✗ Incorrect
The correct class is dropdown-menu-end. Bootstrap uses this class to align dropdown menus to the right.
What is the default alignment of a Bootstrap dropdown menu?
ACenter aligned
BLeft aligned
CRight aligned
DJustified
✗ Incorrect
By default, dropdown menus align to the left side of the toggle button.
How can you center a dropdown menu in Bootstrap?
AUse custom CSS with left 50% and transform translateX(-50%)
BUse dropdown-menu-end and dropdown-menu-start together
CBootstrap does not support dropdown menus
DUse class dropdown-menu-center
✗ Incorrect
Bootstrap does not have a built-in center alignment class, so custom CSS is needed to center the dropdown menu.
Which HTML element typically contains the dropdown menu items in Bootstrap?
A<nav>
B<ul>
C<div class='dropdown-menu'>
D<section>
✗ Incorrect
Dropdown menu items are placed inside a <div> with the class dropdown-menu.
Why should dropdown menus be aligned properly?
ATo improve navigation and accessibility
BTo confuse users
CTo make the page load faster
DTo increase font size
✗ Incorrect
Proper alignment helps users find menu items easily and supports keyboard and screen reader navigation.
Explain how to align a dropdown menu to the right using Bootstrap classes.
Think about the class that changes the menu's horizontal position.
You got /3 concepts.
Describe why dropdown menu alignment matters for user experience and accessibility.
Consider how users interact with menus visually and with assistive tools.
You got /4 concepts.
Practice
(1/5)
1. Which Bootstrap class aligns a dropdown menu to the right side of its toggle button?
easy
A. dropdown-menu-start
B. dropdown-menu-end
C. dropdown-menu-center
D. dropdown-menu-right
Solution
Step 1: Understand dropdown alignment classes
Bootstrap uses dropdown-menu-start to align left, dropdown-menu-end to align right, and dropdown-menu-center to center the dropdown menu.
Step 2: Identify the class for right alignment
The class dropdown-menu-end aligns the dropdown menu to the right side of the toggle button.
Final Answer:
dropdown-menu-end -> Option B
Quick Check:
Right alignment = dropdown-menu-end [OK]
Hint: Right side alignment uses dropdown-menu-end class [OK]
Common Mistakes:
Using dropdown-menu-right which does not exist
Confusing dropdown-menu-start with right alignment
Forgetting to add the class to the dropdown menu element
2. Which is the correct syntax to align a Bootstrap dropdown menu to the left side?
easy
A. <ul class='dropdown-menu dropdown-menu-start'>
B. <ul class='dropdown-menu-left'>
C. <ul class='dropdown-menu dropdown-menu-end'>
D. <ul class='dropdown-menu-start'>
Solution
Step 1: Recognize required base class
Bootstrap dropdown menus require the base class dropdown-menu for styling and behavior.
Step 2: Add alignment class correctly
The alignment class dropdown-menu-start must be combined with dropdown-menu in the class attribute, like dropdown-menu dropdown-menu-start.
Final Answer:
<ul class='dropdown-menu dropdown-menu-start'> -> Option A
Quick Check:
Base class + alignment class = dropdown-menu dropdown-menu-start [OK]
Hint: Always include 'dropdown-menu' before alignment class [OK]
Common Mistakes:
Omitting the base 'dropdown-menu' class
Using non-existent class 'dropdown-menu-left'
Placing alignment class without base class
3. What will be the visual alignment of the dropdown menu in this code?
Bootstrap aligns dropdown menus left by default, right with dropdown-menu-end, and center with dropdown-menu-center. So this menu will appear centered.
Final Answer:
Dropdown menu centered below the toggle button -> Option C
Quick Check:
dropdown-menu-center means center alignment [OK]
Hint: dropdown-menu-center centers menu under toggle button [OK]
Common Mistakes:
Assuming dropdown-menu-center aligns right
Forgetting default is left alignment
Thinking menu won't show without extra JS
4. You want to align a dropdown menu to the right, but it still appears left-aligned. What is the likely error in this code?