0
0
Bootsrapmarkup~20 mins

Responsive images in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Responsive Image Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does the img-fluid class do in Bootstrap?
In Bootstrap, what is the main effect of adding the img-fluid class to an <img> element?
AIt crops the image to a square shape regardless of original dimensions.
BIt adds a fixed width and height to the image, ignoring the container size.
CIt makes the image scale nicely to the parent container's width, keeping its aspect ratio.
DIt disables image loading on small screens to save bandwidth.
Attempts:
2 left
💡 Hint
Think about how images behave when the screen size changes.
📝 Syntax
intermediate
2:00remaining
Which Bootstrap class makes an image rounded and responsive?
You want an image that is both responsive and has rounded corners using Bootstrap classes. Which option correctly applies both?
A<img src="photo.jpg" class="img-fluid rounded" alt="Photo">
B<img src="photo.jpg" class="rounded img-responsive" alt="Photo">
C<img src="photo.jpg" class="img-rounded img-fluid" alt="Photo">
D<img src="photo.jpg" class="responsive rounded-circle" alt="Photo">
Attempts:
2 left
💡 Hint
Check Bootstrap 5 class names for responsiveness and rounding.
rendering
advanced
2:00remaining
What will be the visual result of this Bootstrap image code on a small screen?
Consider this HTML snippet:
<img src="landscape.jpg" class="img-fluid rounded-circle" alt="Landscape">

What will the image look like on a small mobile screen?
Bootsrap
<img src="landscape.jpg" class="img-fluid rounded-circle" alt="Landscape">
AA circular image that scales down to fit the screen width, keeping its shape.
BA square image with sharp corners that does not resize on small screens.
CAn image that is cropped to a circle but stays at original size, causing overflow.
DA blurred image with a circular border that fills the entire screen.
Attempts:
2 left
💡 Hint
Think about what img-fluid and rounded-circle do together.
selector
advanced
2:00remaining
Which CSS selector targets only responsive images with rounded corners in Bootstrap?
You want to write custom CSS that styles only images that have both img-fluid and rounded classes in Bootstrap. Which selector is correct?
Aimg .img-fluid.rounded
B.img-fluid .rounded img
C.img-fluid, .rounded img
Dimg.img-fluid.rounded
Attempts:
2 left
💡 Hint
Remember how to select elements with multiple classes.
accessibility
expert
2:00remaining
What is the best practice for accessible responsive images in Bootstrap?
You have a responsive image using Bootstrap's img-fluid class. Which practice improves accessibility the most?
Bootsrap
<img src="logo.png" class="img-fluid" alt="Company logo">
AUse empty <code>alt=""</code> to hide decorative images from screen readers.
BAlways include a meaningful <code>alt</code> attribute describing the image content.
CAdd <code>aria-hidden="true"</code> to all images to prevent screen reader distraction.
DUse <code>title</code> attribute instead of <code>alt</code> for better screen reader support.
Attempts:
2 left
💡 Hint
Think about how screen readers understand images.