0
0
Bootsrapmarkup~5 mins

Scrollable and centered modals in Bootsrap - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does a scrollable modal in Bootstrap do?
A scrollable modal allows the modal body content to scroll vertically if it is too long, keeping the header and footer fixed and visible.
Click to reveal answer
beginner
How do you center a modal vertically in Bootstrap?
Add the class modal-dialog-centered to the modal-dialog element to vertically center the modal in the viewport.
Click to reveal answer
beginner
Which Bootstrap class makes the modal body scrollable?
The class modal-dialog-scrollable added to modal-dialog makes the modal body scrollable.
Click to reveal answer
intermediate
Why is it important to keep modals accessible when making them scrollable and centered?
Accessibility ensures keyboard users can navigate the modal easily, screen readers can read content properly, and focus is trapped inside the modal until it is closed.
Click to reveal answer
intermediate
What HTML structure is required for a Bootstrap modal to be scrollable and centered?
Use div.modal-dialog.modal-dialog-scrollable.modal-dialog-centered inside div.modal. This combination makes the modal body scrollable and centers the modal vertically.
Click to reveal answer
Which class centers a Bootstrap modal vertically?
Amodal-dialog-centered
Bmodal-scrollable
Cmodal-center
Dmodal-vertical
To make the modal body scrollable, which class should you add?
Amodal-body-scroll
Bmodal-scrollbar
Cmodal-scroll
Dmodal-dialog-scrollable
What happens if modal content is too long without scrollable class?
AModal body scrolls automatically
BModal content overflows outside viewport
CModal closes automatically
DModal header scrolls instead
Which element should have the scrollable and centered classes?
Adiv.modal-dialog
Bdiv.modal-content
Cdiv.modal
Ddiv.modal-body
Why is keyboard focus important in modals?
ATo close the modal automatically
BTo allow users to scroll the page behind the modal
CTo trap focus inside the modal for accessibility
DTo disable modal scrolling
Explain how to create a Bootstrap modal that is both scrollable and vertically centered.
Think about which element gets the special classes for scroll and center.
You got /3 concepts.
    Describe why accessibility matters when designing scrollable and centered modals.
    Consider users who rely on keyboard or screen readers.
    You got /4 concepts.