A card image is an image placed inside a Bootstrap card component, usually at the top or bottom, to visually represent the card content.
Click to reveal answer
beginner
How do you add an overlay on a card image in Bootstrap?
You add an overlay by placing a card-img-overlay div inside the card with the image. This overlay can contain text or other content displayed over the image.
Click to reveal answer
beginner
Which Bootstrap class makes the card image fill the card width automatically?
The class card-img-top or card-img-bottom makes the image fill the card's width at the top or bottom respectively.
Click to reveal answer
intermediate
What is the purpose of card-img-overlay in Bootstrap cards?
It allows you to place text or other content on top of the card image, creating a layered effect with the image as background.
Click to reveal answer
intermediate
Can you use multiple elements inside a card-img-overlay? If yes, give an example.
Yes, you can add headings, paragraphs, buttons, or any HTML inside card-img-overlay. For example, a heading and a button can appear over the image.
Click to reveal answer
Which class is used to place an image at the top of a Bootstrap card?
Acard-img-bottom
Bcard-img-overlay
Ccard-img-top
Dcard-image
✗ Incorrect
The card-img-top class places the image at the top of the card.
What does the card-img-overlay class do?
APlaces content over the card image as an overlay
BAdds a border around the card image
CResizes the card image
DRemoves the card image
✗ Incorrect
The card-img-overlay class places content like text or buttons over the card image.
Where should the card-img-overlay div be placed in the card structure?
AOutside the card
BInside the card but outside the image
CBefore the card element
DInside the card and inside the image container
✗ Incorrect
The card-img-overlay should be inside the card but outside the image.
Which of these is NOT a valid Bootstrap card image class?
Acard-img-center
Bcard-img-bottom
Ccard-img-top
Dcard-img-overlay
✗ Incorrect
card-img-center is not a valid Bootstrap class.
What kind of content can you put inside a card-img-overlay?
AOnly links
BOnly text
COnly images
DAny HTML content like text, buttons, or headings
✗ Incorrect
You can put any HTML content inside card-img-overlay, such as text, buttons, or headings.
Explain how to create a Bootstrap card with an image and text overlay on top of the image.
Think about layering content on top of an image inside a card.
You got /4 concepts.
Describe the difference between card-img-top and card-img-overlay in Bootstrap cards.
One is for image placement, the other is for layering content.
You got /3 concepts.
Practice
(1/5)
1. What is the purpose of the card-img-overlay class in Bootstrap cards?
easy
A. To add a border around the card image
B. To place text or content on top of the card image
C. To resize the card image automatically
D. To add a shadow effect to the card image
Solution
Step 1: Understand the role of card-img-overlay
This class is used to add content that appears over the card image, such as text or buttons.
Step 2: Compare with other options
Other options describe effects or styles not related to overlays, so they are incorrect.
Final Answer:
To place text or content on top of the card image -> Option B
Quick Check:
Overlay content = card-img-overlay = B [OK]
Hint: Overlay means content on top of image [OK]
Common Mistakes:
Confusing overlay with image resizing
Thinking overlay adds borders or shadows
Ignoring that overlay is for layering content
2. Which of the following is the correct way to add an image inside a Bootstrap card with an overlay?
easy
A.
Text
B.
Text
C.
Text
D.
Text
Solution
Step 1: Check correct structure for image and overlay
The image uses card-img class and the overlay content uses card-img-overlay inside the card container.
Step 2: Validate
Text
structure
Text
correctly places the image first with card-img and overlay div after with card-img-overlay.
Final Answer:
<div class='card'><img src='img.jpg' class='card-img'><div class='card-img-overlay'>Text</div></div> -> Option D
Quick Check:
Image class = card-img, Overlay class = card-img-overlay [OK]