Recall & Review
beginner
What is the purpose of the Bootstrap
figure component?The Bootstrap
figure component is used to display images with optional captions in a clean, semantic way. It groups an image and its caption together for better structure and styling.Click to reveal answer
beginner
Which Bootstrap class is used to style the caption text inside a <code>figure</code>?The class
figure-caption is used to style the caption text inside a figure component.Click to reveal answer
beginner
How do you make a responsive image inside a Bootstrap
figure?Add the Bootstrap class
img-fluid to the <img> tag inside the figure. This makes the image scale nicely on different screen sizes.Click to reveal answer
beginner
Write the basic HTML structure of a Bootstrap figure with an image and a caption.
Use this structure:
<figure class="figure">
<img src="image.jpg" class="figure-img img-fluid rounded" alt="Description">
<figcaption class="figure-caption">Caption text here.</figcaption>
</figure>
Click to reveal answer
beginner
Why should you always include the
alt attribute on images inside a figure?The
alt attribute provides alternative text for screen readers and helps with accessibility. It describes the image content for users who cannot see it.Click to reveal answer
Which HTML element is used to group an image and its caption in Bootstrap's figure component?
✗ Incorrect
The <figure> element semantically groups an image and its caption.
What class should you add to an image inside a figure to make it responsive in Bootstrap?
✗ Incorrect
The class img-fluid makes images scale nicely to the parent container.
Which class styles the caption text inside a Bootstrap figure?
✗ Incorrect
The figure-caption class is used for caption styling.
What is the correct way to add a caption inside a figure?
✗ Incorrect
The <figcaption> element is the semantic way to add captions inside <figure>.
Why is it important to include the alt attribute on images?
✗ Incorrect
The alt attribute helps screen readers describe images to users who cannot see them.
Explain how to create a Bootstrap figure component with an image and caption that works well on all screen sizes.
Think about grouping, responsive images, and caption styling.
You got /4 concepts.
Describe why semantic HTML elements like
figure and figcaption are important in web development.Consider how these elements help both users and search engines.
You got /4 concepts.