Open In App

What is the use of the modal Class in Bootstrap?

The .modal class in Bootstrap is utilized to create modal dialogs, which are overlay windows that appear on top of the webpage content to present important information or actions.

Important Points

Syntax:

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" 
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Modal content goes here -->
</div>
</div>
</div>

Explanation: The provided syntax creates a modal dialog in Bootstrap, where the .modal class is applied to a <div> element. It includes the necessary attributes and structure to define the modal’s appearance and behavior, facilitating the display of important information or actions in an overlay window on top of the webpage content.

Features:

Article Tags :