Bootstrap Figure Component
📖 Scenario: You are creating a simple webpage to display an image with a caption using Bootstrap's figure component. This is common for showing photos with descriptions on blogs or portfolios.
🎯 Goal: Build a Bootstrap figure component that shows an image with a caption below it. The caption should be centered and styled properly.
📋 What You'll Learn
Use the
<figure> element with the Bootstrap class figure.Include an
<img> inside the figure with the class figure-img and img-fluid for responsiveness.Add a
<figcaption> with the class figure-caption and center the text.Use Bootstrap 5 classes only, no custom CSS.
Ensure the HTML document has proper
lang, charset, and viewport meta tags.💡 Why This Matters
🌍 Real World
Figures with captions are common in blogs, portfolios, and product pages to show images with descriptions clearly and accessibly.
💼 Career
Knowing how to use Bootstrap components like figure helps you quickly build professional-looking, responsive web pages that are easy to maintain.
Progress0 / 4 steps