0
0
Bootsrapmarkup~20 mins

Image thumbnails in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Thumbnail Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
Thumbnail Image Size with Bootstrap
You have this Bootstrap thumbnail image code:

<img src='img.jpg' class='img-thumbnail' alt='Sample'>

What will be the visual effect of the img-thumbnail class on the image?
Bootsrap
<img src='img.jpg' class='img-thumbnail' alt='Sample'>
AThe image will have a small border and padding, making it look like a framed thumbnail.
BThe image will have rounded corners but no border or padding.
CThe image will be hidden and replaced by a placeholder icon.
DThe image will be stretched to fill the entire container width without border.
Attempts:
2 left
💡 Hint
Think about what a thumbnail usually looks like: a small framed picture.
selector
intermediate
2:00remaining
Bootstrap Class for Responsive Thumbnails
Which Bootstrap class should you add to an image to make it scale nicely on all screen sizes while keeping the thumbnail style?
Aimg-thumbnail img-fluid
Bimg-thumbnail img-responsive
Cthumbnail-responsive
Dimg-responsive img-rounded
Attempts:
2 left
💡 Hint
Bootstrap 5 uses img-fluid for responsive images.
🧠 Conceptual
advanced
2:00remaining
Accessibility for Image Thumbnails
Why is it important to include the alt attribute on thumbnail images in Bootstrap?
AIt automatically resizes the image to thumbnail size.
BIt provides descriptive text for screen readers, helping visually impaired users understand the image content.
CIt adds a tooltip that appears on hover with the image filename.
DIt changes the image border color to improve contrast.
Attempts:
2 left
💡 Hint
Think about users who cannot see images.
layout
advanced
2:00remaining
Arranging Multiple Thumbnails with Bootstrap Grid
You want to display 4 thumbnail images side by side on large screens and stacked on small screens. Which Bootstrap classes should you use on the container and images?
AUse <code>grid</code> on container and <code>thumbnail</code> on images without columns.
BUse <code>container</code> on container and <code>col-4</code> on images without any row.
CUse <code>row</code> on container and <code>col-lg-3 col-12</code> on each image wrapper with <code>img-thumbnail img-fluid</code> on images.
DUse <code>row</code> on container and <code>col-6</code> on images with <code>img-rounded</code> class.
Attempts:
2 left
💡 Hint
Bootstrap grid uses rows and columns with breakpoints like lg and col-12 for full width on small screens.
📝 Syntax
expert
2:00remaining
Identify the Error in Thumbnail Image Code
What error will this Bootstrap thumbnail image code cause?

<img src='photo.jpg' class='img-thumbnail img-fluid' alt>
Bootsrap
<img src='photo.jpg' class='img-thumbnail img-fluid' alt>
AThe <code>alt</code> attribute is empty but valid; no error occurs.
BThe image will not display because <code>alt</code> is required to have text.
CThe <code>class</code> attribute is invalid because it has two classes.
DMissing value for <code>alt</code> attribute causes HTML validation error.
Attempts:
2 left
💡 Hint
Check how attributes are written in HTML.