Challenge & Quiz: Mastering Advanced Bootstrap Features
Task: Creating a Bootstrap Modal
Create a Bootstrap modal window component that displays product details. Follow the steps provided in the initial code to fill in the missing Bootstrap classes and complete the modal structure.
- Step 1: Create modal structure.
- Apply the
modal
class to the outermost container; - Use the
modal-dialog
class for the dialog box; - Add the
modal-content
class for the content area; - Ensure the modal is centered vertically within the viewport by applying the
modal-dialog-centered
class to themodal-dialog
container; - Use the
modal-title
class for the title element (<h5>
); - Apply the
btn-close
class to the close button within the modal header.
- Apply the
- Step 2: Add Product Details.
- Insert the product image within the modal body and ensure it scales appropriately using the
img-fluid
class; - Display the product title using an appropriate heading tag (
<h6>
) and apply themodal-title
class; - Provide a brief product description using a paragraph element (
<p>
) and apply themodal-text
class.
- Insert the product image within the modal body and ensure it scales appropriately using the
index.html
1. What is the primary purpose of Bootstrap's Navbars?
2. What class should be used to create a basic navbar structure?
3. What class should be applied to images to make them responsive?
4. What additional classes can be used for styling images as thumbnails?
5. Which Bootstrap component is suitable for showcasing articles, user profiles, and products in a structured way?
6. Which Bootstrap component is used to create interactive image sliders?
7. What class should be applied to the container element of a carousel?
Takk for tilbakemeldingene dine!