0
0
Bootsrapmarkup~20 mins

Progress bars in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Progress Bar Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
AA green horizontal bar filling half the width inside a thin progress container.
BA blue horizontal bar filling the entire width inside a tall progress container.
CA red horizontal bar filling 75% width inside a thin progress container.
DNo visible bar because the width is set to 0%.
Attempts:
2 left
💡 Hint
Check the class 'bg-success' and the style width percentage.
selector
intermediate
2: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>
A.progress-bar
B.progress-bar > .progress
C.progress .progress-bar > div
D.progress > .progress-bar
Attempts:
2 left
💡 Hint
Look for the direct child selector between container and bar.
🧠 Conceptual
advanced
2: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?
Aaria-label, aria-hidden, role="progressbar"
Baria-valuenow, aria-valuemin, aria-valuemax, role="progressbar"
Caria-checked, aria-expanded, role="progressbar"
Daria-live, aria-atomic, role="progressbar"
Attempts:
2 left
💡 Hint
Think about attributes that describe the progress value and range.
layout
advanced
2: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?
A
&lt;div class="progress"&gt;
  &lt;div class="progress-bar bg-info" style="width: 30%;"&gt;&lt;/div&gt;
  &lt;div class="progress-bar bg-warning" style="width: 50%;"&gt;&lt;/div&gt;
&lt;/div&gt;
B
&lt;div class="progress"&gt;
  &lt;div class="progress-bar bg-info" style="width: 30%;"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="progress"&gt;
  &lt;div class="progress-bar bg-warning" style="width: 50%;"&gt;&lt;/div&gt;
&lt;/div&gt;
C
&lt;div class="progress"&gt;
  &lt;div class="progress-bar bg-info" style="width: 50%;"&gt;&lt;/div&gt;
  &lt;div class="progress-bar bg-warning" style="width: 30%;"&gt;&lt;/div&gt;
&lt;/div&gt;
D
&lt;div class="progress"&gt;
  &lt;div class="progress-bar bg-info" style="width: 80%;"&gt;&lt;/div&gt;
&lt;/div&gt;
Attempts:
2 left
💡 Hint
Stacked bars are multiple progress-bar divs inside one progress container.
📝 Syntax
expert
2: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>
AThe progress bar will be invisible because width exceeds 100%.
BThe browser will throw a syntax error and not render the bar.
CThe progress bar will overflow the container visually, showing more than 100%.
DThe progress bar will automatically clamp to 100% width without overflow.
Attempts:
2 left
💡 Hint
CSS width can exceed 100%, causing overflow.