Make Modal Body Scrollable in Bootstrap 5, 4, and 3

Last Updated on January 4, 2025 by Roshan Parihar

Learn how to make modal body scrollable in Bootstrap 5 and other versions. The short answer is to use the class .modal-dialog-scrollable. let’s find out with the examples given below.

How to Make Scrollable Modal in Bootstrap 5

To make the modal body scrollable in Bootstrap 5, add the class .modal-dialog-scrollable to the <div> element having class .modal-dialog as given below.

Test it Live

Output

How to Make Scrollable Modal in Bootstrap 5

You can click the button given above to see the live preview with scroll modal content. Scroll your mouse up and down to see the required result.

Scrollable Modal in Bootstrap 4

For making the modal scrollable in Bootstrap 4, you can add the class .modal-dialog-scrollable to the <div> element where class .modal-dialog is present.

Test it Live

Output

Scrollable Modal in Bootstrap 4

To see the live preview, you can click the button above. After that, again click the button and scroll up and down to see the scrollable content of modal.

Body Scrolling in Bootstrap 3

There are no class present in Bootstrap 3 to achieve the scrollable content in Bootstrap 3. However, you add some CSS to the modal body to make display scroll up and down.

Test it Live

Output

Body Scrolling in Bootstrap 3

If you want to see the required result in Bootstrap 3, you have to click the above button for live preview. After you click the button, scroll up and down to see the content of the modal.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.