Challenge - 5 Problems
Select Menu Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual output of this Bootstrap select menu?
Look at the following Bootstrap select menu code. What will you see rendered in the browser?
Bootsrap
<select class="form-select" aria-label="Fruit selection"> <option selected>Choose a fruit</option> <option value="1">Apple</option> <option value="2">Banana</option> <option value="3">Cherry</option> </select>
Attempts:
2 left
💡 Hint
Remember,
✗ Incorrect
The
❓ accessibility
intermediate2:00remaining
Which attribute improves accessibility for this select menu?
You have this select menu code. Which attribute should you add or keep to help screen readers understand it?
Bootsrap
<select class="form-select"> <option value="1">Red</option> <option value="2">Green</option> <option value="3">Blue</option> </select>
Attempts:
2 left
💡 Hint
Screen readers need a label to describe the purpose of form controls.
✗ Incorrect
The aria-label attribute provides an accessible name for the select menu, so screen readers can announce what the menu is for. tabindex="-1" removes it from keyboard navigation, role="button" is incorrect for select, and disabled="true" disables the control.
📝 Syntax
advanced2:00remaining
What error occurs with this select menu code?
Examine this Bootstrap select menu code. What error or problem will happen when you try to use it?
Bootsrap
<select class="form-select" multiple> <option value="a">Option A</option> <option value="b">Option B</option> <option value="c">Option C</option> </select>
Attempts:
2 left
💡 Hint
In HTML, boolean attributes like 'multiple' do not need a value.
✗ Incorrect
The 'multiple' attribute on a
❓ selector
advanced2:00remaining
Which CSS selector targets only enabled options inside a Bootstrap select menu?
You want to style only the enabled
Attempts:
2 left
💡 Hint
Use the negation pseudo-class to exclude disabled options.
✗ Incorrect
The :not(:disabled) selector matches options that are not disabled, effectively selecting enabled options. The :enabled pseudo-class does not apply to
❓ layout
expert2:00remaining
How to make a Bootstrap select menu fill the width of its container responsively?
You want your Bootstrap select menu to always fill 100% width of its parent container on all screen sizes. Which CSS or class approach achieves this best?
Bootsrap
<select class="form-select"> <option>Option 1</option> <option>Option 2</option> </select>
Attempts:
2 left
💡 Hint
Bootstrap utility classes like 'w-100' set width to 100%.
✗ Incorrect
The 'w-100' class in Bootstrap sets width to 100% of the parent container, making the select fill the container responsively. Using 'width: 100vw;' makes it fill the viewport width, which can cause horizontal scrolling. 'd-flex' controls flex layout but does not set width. 'container' is a layout wrapper class, not for form controls.