An image thumbnail is a smaller version of a larger image. It helps pages load faster and shows a preview without using much space.
Click to reveal answer
beginner
How do you create a thumbnail using Bootstrap?
Use the <code>img-thumbnail</code> class on an <code><img></code> tag. This adds a border and padding to make the image look like a thumbnail.
Click to reveal answer
intermediate
Why should thumbnails be responsive?
Responsive thumbnails adjust their size on different screen sizes, so they look good on phones, tablets, and desktops without breaking the layout.
Click to reveal answer
beginner
What Bootstrap class helps make images responsive?
The <code>img-fluid</code> class makes images scale nicely to the parent container's width, keeping them responsive.
Click to reveal answer
beginner
How can you add accessibility to image thumbnails?
Add descriptive alt text to the <img> tag so screen readers can explain the image to users who cannot see it.
Click to reveal answer
Which Bootstrap class adds a border and padding to create a thumbnail effect?
Aimg-thumbnail
Bimg-responsive
Cimg-rounded
Dimg-fluid
✗ Incorrect
The img-thumbnail class adds a border and padding to make the image look like a thumbnail.
What class should you add to make an image scale nicely on all screen sizes?
Aimg-responsive
Bimg-thumbnail
Cimg-fluid
Dimg-rounded
✗ Incorrect
The img-fluid class makes images responsive by scaling them to the width of their container.
Why use thumbnails instead of full-size images on a webpage?
ATo save space and load faster
BTo remove image borders
CTo make images blurry
DTo make the page load slower
✗ Incorrect
Thumbnails save space and help pages load faster by showing smaller versions of images.
Which attribute is important for accessibility on image thumbnails?
Atitle
Bsrc
Chref
Dalt
✗ Incorrect
The alt attribute provides descriptive text for screen readers.
If you want a thumbnail image to adjust size on mobile devices, what should you do?
AAdd <code>img-thumbnail</code> only
BAdd both <code>img-thumbnail</code> and <code>img-fluid</code>
CAdd <code>img-fluid</code> only
DNo classes needed
✗ Incorrect
Using both img-thumbnail and img-fluid makes the image look like a thumbnail and stay responsive.
Explain how to create a responsive image thumbnail using Bootstrap and why it is useful.
Think about combining style and responsiveness classes.
You got /4 concepts.
Describe how to make image thumbnails accessible for all users.
Accessibility means helping users who rely on screen readers or have vision challenges.
You got /4 concepts.
Practice
(1/5)
1. What does the Bootstrap class img-thumbnail do when added to an <img> tag?
easy
A. It changes the image to grayscale.
B. It makes the image full width of the container.
C. It hides the image from view.
D. It adds a border and padding to create a small framed image.
Solution
Step 1: Understand the purpose of img-thumbnail
The img-thumbnail class in Bootstrap styles images with a border and padding to look like thumbnails.
Step 2: Compare with other options
Options B, C, and D describe behaviors unrelated to img-thumbnail. Only It adds a border and padding to create a small framed image. correctly describes the border and padding effect.
Final Answer:
It adds a border and padding to create a small framed image. -> Option D
Quick Check:
Thumbnail styling = border + padding [OK]
Hint: Remember thumbnails have a border and padding by default [OK]
Common Mistakes:
Confusing thumbnail with full-width image
Thinking it hides the image
Assuming it changes image colors
2. Which of the following is the correct way to add a Bootstrap thumbnail style to an image?
easy
A. <img src='pic.jpg' class='img-thumbnail' alt='pic'>
B. <img src='pic.jpg' class='img_thumb' alt='pic'>
C. <img src='pic.jpg' class='thumbnail' alt='pic'>
D. <img src='pic.jpg' class='img-thumbnailed' alt='pic'>
Solution
Step 1: Recall the exact Bootstrap class name
The correct Bootstrap class for thumbnails is img-thumbnail, not any variation.
Step 2: Check each option's class
<img src='pic.jpg' class='img-thumbnail' alt='pic'> uses img-thumbnail exactly. Options A, B, and D use incorrect or non-existent class names.
Final Answer:
<img src='pic.jpg' class='img-thumbnail' alt='pic'> -> Option A
Quick Check:
Class name must be img-thumbnail [OK]
Hint: Use exact class img-thumbnail for thumbnails [OK]
Common Mistakes:
Misspelling the class name
Using underscores instead of hyphens
Omitting the class attribute
3. What will be the visual result of this HTML snippet?
B. The class name should be img-thumbnail with a hyphen, not underscore.
C. The src attribute is incorrect.
D. The img tag must be inside a <div>.
Solution
Step 1: Check the class name spelling
The class name uses an underscore img_thumbnail, but Bootstrap requires a hyphen: img-thumbnail.
Step 2: Verify other attributes
The alt attribute is present, and src looks correct. The img tag does not require a div wrapper for thumbnails.
Final Answer:
The class name should be img-thumbnail with a hyphen, not underscore. -> Option B
Quick Check:
Class name spelling matters: hyphen, not underscore [OK]
Hint: Check class spelling carefully: hyphen, not underscore [OK]
Common Mistakes:
Using underscore instead of hyphen in class
Thinking alt attribute affects thumbnail style
Believing img needs a div wrapper
5. You want to display three image thumbnails side by side, each with equal spacing and responsive sizing. Which Bootstrap classes and structure should you use?
Step 1: Understand layout for side-by-side thumbnails
Using Bootstrap grid with row and col classes places images side by side with equal width and spacing.
Step 2: Check each option's layout approach
<div class='row'><div class='col'><img src='1.jpg' class='img-thumbnail' alt='1'></div><div class='col'><img src='2.jpg' class='img-thumbnail' alt='2'></div><div class='col'><img src='3.jpg' class='img-thumbnail' alt='3'></div></div> uses row and col correctly. <div class='d-flex gap-3'><img src='1.jpg' class='img-thumbnail flex-fill' alt='1'><img src='2.jpg' class='img-thumbnail flex-fill' alt='2'><img src='3.jpg' class='img-thumbnail flex-fill' alt='3'></div> uses flex but may cause uneven sizing without container. Options B and C lack layout classes for spacing and responsiveness.