0
0
Bootsrapmarkup~20 mins

Sizing utilities (width, height) in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sizing Utilities Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Bootstrap width utility classes
Which Bootstrap class will set an element's width to 50% of its parent container?
Aw-5
Bwidth-50
Cw-half
Dw-50
Attempts:
2 left
💡 Hint
Bootstrap uses 'w-' prefix followed by a number to set width in percentages.
📝 Syntax
intermediate
2:00remaining
Correct usage of height utility classes
Which class correctly sets an element's height to 100% in Bootstrap?
Ah-100
Bheight-100
Ch-full
Dheight-full
Attempts:
2 left
💡 Hint
Bootstrap height utilities use 'h-' prefix with numbers.
rendering
advanced
3: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>
AWidth: 25px, Height: 150px, Blue background
BWidth: 25px, Height: 50px, Blue background
CWidth: 100px, Height: 150px, Blue background
DWidth: 100px, Height: 50px, Blue background
Attempts:
2 left
💡 Hint
Calculate 25% of 400px and 50% of 300px.
selector
advanced
2:00remaining
Choosing the correct class for max-width
Which Bootstrap class sets the maximum width of an element to 100% of its parent container?
Amax-w-100
Bmw-100
Cmaxwidth-100
Dmw-full
Attempts:
2 left
💡 Hint
Bootstrap uses 'mw-' prefix for max-width utilities.
accessibility
expert
3: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?
AEnsure the element has sufficient size for easy clicking and add ARIA labels if needed
BSet width and height to fixed pixel values instead of percentages for consistency
CUse only width utilities and avoid height utilities to prevent confusion
DAvoid using any sizing utilities on interactive elements to prevent layout shifts
Attempts:
2 left
💡 Hint
Think about how users interact with elements and screen readers.