Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set twitter bootstrap modal wider and higher?

How to set twitter bootstrap modal wider and higher?

Example here (please click: Launch demo modal):

http://twitter.github.com/bootstrap/javascript.html#modals

like image 511
mamasi Avatar asked Feb 17 '13 09:02

mamasi


People also ask

How can I increase width and height of bootstrap modal?

Change the size of the modal by adding the . modal-sm class for small modals, . modal-lg class for large modals, or . modal-xl for extra large modals.

How do I change the height of a bootstrap modal?

modal max-height is 100vh . Then for . modal-body use calc() function to calculate desired height. In above case we want to occupy 80vh of the viewport, reduced by the size of header + footer in pixels.

Which class is used to create large size modals bootstrap?

Modal Size modal-lg class for large modals.


1 Answers

In Bootstrap 3.1.1 they added modal-lg and modal-sm classes. You control the modal size using @media queries like they do. This is a more global way of controlling the modal size.

@media (min-width: 992px) {     .modal-lg {         width: 900px;         height: 900px; /* control height here */     } } 

Sample code:

<!-- Large modal --> <button class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>  <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">   <div class="modal-dialog modal-lg">     <div class="modal-content">       ...     </div>   </div> </div>  <!-- Small modal --> <button class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">Small modal</button>  <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">   <div class="modal-dialog modal-sm">     <div class="modal-content">       ...     </div>   </div> </div> 
like image 171
Leniel Maccaferri Avatar answered Sep 21 '22 16:09

Leniel Maccaferri