0
0
Bootsrapmarkup~5 mins

Modal structure and triggers in Bootsrap - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Adata-toggle="dropdown"
Bdata-bs-toggle="modal"
Chref="#modal"
Donclick="openModal()"
What does data-bs-target="#myModal" do?
ASpecifies the modal to open by its ID
BSets the modal title
CCloses the modal
DChanges modal size
Which class is used for the modal's main content area?
Amodal-body
Bmodal-header
Cmodal-footer
Dmodal-content
How can a user close a Bootstrap modal using the keyboard?
APress the Spacebar
BPress the Enter key
CPress the Tab key
DPress the Escape key
Which element usually contains the modal's close button?
Amodal-footer
Bmodal-body
Cmodal-header
Dmodal-dialog
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.