Recall & Review
beginner
What is a modal in Bootstrap?
A modal is a popup window that appears on top of the main page content to grab the user's attention for important information or actions.
Click to reveal answer
beginner
Which HTML element attribute is used to trigger a Bootstrap modal?
The
data-bs-toggle="modal" attribute is used on a button or link to trigger the modal to open.Click to reveal answer
beginner
What role does the
data-bs-target attribute play in Bootstrap modals?It specifies which modal to open by pointing to the modal's ID, for example
data-bs-target="#myModal".Click to reveal answer
beginner
Name the main parts inside a Bootstrap modal structure.
The main parts are:
- modal-header - title and close button
- modal-body - main content
- modal-footer - action buttons
Click to reveal answer
intermediate
How do you make a modal accessible for keyboard users?
Bootstrap modals automatically trap keyboard focus inside the modal and allow closing with the Escape key, making them accessible.
Click to reveal answer
Which attribute opens a Bootstrap modal when clicked?
✗ Incorrect
The attribute
data-bs-toggle="modal" tells Bootstrap to open the modal on click.What does
data-bs-target="#myModal" do?✗ Incorrect
It points to the modal element with ID 'myModal' to open it.
Which class is used for the modal's main content area?
✗ Incorrect
The
modal-body class holds the main content inside the modal.How can a user close a Bootstrap modal using the keyboard?
✗ Incorrect
Pressing Escape closes the modal for keyboard accessibility.
Which element usually contains the modal's close button?
✗ Incorrect
The close button is typically inside the
modal-header.Describe the basic HTML structure of a Bootstrap modal and how it is triggered.
Think about the nested divs and the button attributes that open the modal.
You got /8 concepts.
Explain how Bootstrap modals support accessibility and keyboard navigation.
Consider how users who don't use a mouse can still interact with the modal.
You got /4 concepts.