Challenge - 5 Problems
Sizing Utilities Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding Bootstrap width utility classes
Which Bootstrap class will set an element's width to 50% of its parent container?
Attempts:
2 left
💡 Hint
Bootstrap uses 'w-' prefix followed by a number to set width in percentages.
✗ Incorrect
The class w-50 sets the width to 50% of the parent container. Other options are not valid Bootstrap width utilities.
📝 Syntax
intermediate2:00remaining
Correct usage of height utility classes
Which class correctly sets an element's height to 100% in Bootstrap?
Attempts:
2 left
💡 Hint
Bootstrap height utilities use 'h-' prefix with numbers.
✗ Incorrect
The class h-100 sets the height to 100%. Other options are not valid Bootstrap classes.
❓ rendering
advanced3:00remaining
Visual effect of combined width and height utilities
What will be the visible size of a
<div> with classes w-25 h-50 bg-primary inside a container of 400px width and 300px height?Bootsrap
<div class="container" style="width:400px; height:300px; border:1px solid black;"><div class="w-25 h-50 bg-primary"></div></div>
Attempts:
2 left
💡 Hint
Calculate 25% of 400px and 50% of 300px.
✗ Incorrect
The w-25 sets width to 25% of 400px = 100px. The h-50 sets height to 50% of 300px = 150px. The bg-primary adds a blue background.
❓ selector
advanced2:00remaining
Choosing the correct class for max-width
Which Bootstrap class sets the maximum width of an element to 100% of its parent container?
Attempts:
2 left
💡 Hint
Bootstrap uses 'mw-' prefix for max-width utilities.
✗ Incorrect
The class mw-100 sets max-width to 100%. Other options are not valid Bootstrap classes.
❓ accessibility
expert3:00remaining
Accessibility considerations with sizing utilities
When using fixed width and height utilities like
w-25 and h-50 on interactive elements, what is the best practice to maintain accessibility?Attempts:
2 left
💡 Hint
Think about how users interact with elements and screen readers.
✗ Incorrect
Fixed sizes can make elements too small to interact with. Ensuring sufficient size and adding ARIA labels helps users with disabilities. Other options either limit flexibility or are impractical.