Challenge - 5 Problems
Progress Bar Pro
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 progress bar code?
Look at this Bootstrap progress bar code snippet. What will you see in the browser?
Bootsrap
<div class="progress" style="height: 1.5rem;"> <div class="progress-bar bg-success" role="progressbar" style="width: 50%;" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div> </div>
Attempts:
2 left
💡 Hint
Check the class 'bg-success' and the style width percentage.
✗ Incorrect
The 'bg-success' class colors the bar green. The width style '50%' means the bar fills half the container horizontally. The container height is 1.5rem, so the bar is thin and horizontal.
❓ selector
intermediate2:00remaining
Which CSS selector targets only the progress bar inside a progress container?
Given this HTML structure, which CSS selector correctly styles only the progress bar inside the progress container?
<div class="progress">
<div class="progress-bar"></div>
</div>
Attempts:
2 left
💡 Hint
Look for the direct child selector between container and bar.
✗ Incorrect
The selector '.progress > .progress-bar' targets only elements with class 'progress-bar' that are direct children of elements with class 'progress'. Option D selects all progress bars anywhere, options B and C are invalid for this structure.
🧠 Conceptual
advanced2:00remaining
What ARIA attributes are essential for accessible Bootstrap progress bars?
Which set of ARIA attributes must be included on the progress bar element to make it accessible for screen readers?
Attempts:
2 left
💡 Hint
Think about attributes that describe the progress value and range.
✗ Incorrect
For progress bars, screen readers need to know the current value, minimum, and maximum values, so aria-valuenow, aria-valuemin, aria-valuemax are essential. The role must be 'progressbar'. Other ARIA attributes listed do not describe progress.
❓ layout
advanced2:00remaining
How to create a stacked progress bar with two segments in Bootstrap?
You want a progress bar with two colored segments side by side, filling 30% and 50% respectively. Which code snippet achieves this?
Attempts:
2 left
💡 Hint
Stacked bars are multiple progress-bar divs inside one progress container.
✗ Incorrect
Bootstrap supports stacked progress bars by placing multiple .progress-bar divs inside one .progress container. The widths add up horizontally. Option A correctly stacks 30% and 50%. Option A creates two separate bars stacked vertically. Option A reverses widths. Option A is a single bar.
📝 Syntax
expert2:00remaining
What error occurs with this incorrect Bootstrap progress bar code?
Consider this code snippet:
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 120%;" aria-valuenow="120" aria-valuemin="0" aria-valuemax="100"></div>
</div>
What problem will this cause in the browser?
Bootsrap
<div class="progress"> <div class="progress-bar" role="progressbar" style="width: 120%;" aria-valuenow="120" aria-valuemin="0" aria-valuemax="100"></div> </div>
Attempts:
2 left
💡 Hint
CSS width can exceed 100%, causing overflow.
✗ Incorrect
Setting width to 120% causes the bar to overflow its container visually. Browsers do not clamp width automatically. No syntax error occurs. The bar remains visible but extends beyond the container.