bootstrape vertically center modal

Vertically centered
Add .modal-dialog-centered to .modal-dialog to vertically center the modal.

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

4.2
10
Krish 100200 points

                                    &lt;!-- Button trigger modal --&gt;
&lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot; data-toggle=&quot;modal&quot; data-target=&quot;#exampleModalCenter&quot;&gt;
  Launch demo modal
&lt;/button&gt;

&lt;!-- Modal --&gt;
&lt;div class=&quot;modal fade&quot; id=&quot;exampleModalCenter&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;exampleModalCenterTitle&quot; aria-hidden=&quot;true&quot;&gt;
  &lt;div class=&quot;modal-dialog modal-dialog-centered&quot; role=&quot;document&quot;&gt;
    &lt;div class=&quot;modal-content&quot;&gt;
      &lt;div class=&quot;modal-header&quot;&gt;
        &lt;h5 class=&quot;modal-title&quot; id=&quot;exampleModalCenterTitle&quot;&gt;Modal title&lt;/h5&gt;
        &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;
          &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
        &lt;/button&gt;
      &lt;/div&gt;
      &lt;div class=&quot;modal-body&quot;&gt;
        ...
      &lt;/div&gt;
      &lt;div class=&quot;modal-footer&quot;&gt;
        &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt;
        &lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt;Save changes&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

4.2 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
bootstrap modal center horizontally and vertically bootstrape vertically center modal bootstrap modal prevent content from being vertically centered bootstrap 3 modal vertical center css how to align modal bootstrap 4 vertical vertically central modal bootstrap how to center bootstrap modal vertical center how to center bootstrap modal vertically in different bootstrap versions vertically center modal bootstrap 3 vertically center bootstrap modal center vertical modal bootstrap 3 modal vertical center bootstrap 4 bootstrap modal center vertically css bootstrap 5 modal vertical center modal to appear vertically in the center of the screen in bootstrap 5 position vertically modal bootstrap bootstrap modal vertical middle bootstrap modal center vertical bootstrap modal not scrolling vertically centered boostrap make modal to center in the page vertically bootstrap popup vertical center vertically center modal bootstrap vertical align center bootstrap modal center bootstrap modal vertically modal popup vertical align center modal vertical align middle bootstrap 4 modal popup vertical align center bootstrap 4 modal popup vertical align middle vertically centered bootstrap modal bootstrap 3 vertical center modal bootstrap modal vertical align middle bootstrap modal header text center vertically how to center bootstrap modal vertically center vertically modal bootstrap vertical align modal bootstrap 3 vertical center align bootstrap modal bootstrap 3 modal vertical center vertically centered modal bootstrap 3 Vertically centered modal bootstrap 5 center bootstrap modal example vertical and horizontal modal-dialog-centered bootstrap vertically centering bootstrap modal window modal center of screen bootstrap 4 boostrap modal center page bootstrap popup center screen bootstrap modal center content modal center bootstrap 3 centered modal bootstrap modal bootstrap center vertically bootstrap modal center screen vertically center modal bootstrap 4 modal vertical center bs modal center bootstrap modal center on page on click modal shoe center of thre page bootstrap/3.4 popup model vertically center javascript bootstrap modal bootstrap 4 modal in center of screen bootstrap modal in center of screen bootstrap modal popup in center of screen bootstrap 4 modal popup lar bootstrap 4 modal center horizontally and vertically vertical center modal bootstrap 4 center the bootstrap modal bootstrap modal centered bootstrap modal 3.3.7 bootstrap 3.3.7 modal bootstrap 4 modal popup center screen modal dialog centered center modal on screen bootstrap 4 bootstrap modal popup center modal-aligned bootstrap css popup that will centered modal bootsrap 4 bootstrap 4 modal center bootstrap modal center bootrap modal center bootstrap 4 modal vertical center how to center modal in bootstrap modal bootstrap center screen bootstrap center modal vertically bootstrap modal centered vertically bootstrap 4 modal image text center modal bootstrap vertical center example modal center large bootstrap modal vertical center modal center bootstrap modal open center screen bootstrap modal center of screen modal popup center bootstrap center modal vertically bootstrap auto popup modal modal center bootstrap 4 table center vertically in boostrap modal popup bootstrap model form center pop up bootstrap central modal template modal left bootstrap 4 modal verticel center modal center content bootstrap modal alignment modal center bootstrap bootstrap modal dialog center vertically and horizontally center modal bootstrap center modal in middle of screen bootstrap 4 making bootstrap modal form content center bootswatch modal example bootstrap modal position center bootstrap modal center vertically
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source