Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3.1.0 modal sizing not applied

After updating my bootstrap-sass gem to 3.1.0 to take advantage of the new sizing options on modals (.modal-lg and .modal-sm), I've been unable to get the styling to be applied. My code is as follows:

<div aria-hidden="false" aria-labeldby="ccModalLabel" class="modal fade in" id="ccModal" role="dialog" style="display: block;">
  <div class="modal-dialog modal-sm">
    ...content...
  </div>
</div>

Which, as far as I can tell, is nearly identical to the example in all the attributes that matter:

<div class="modal fade bs-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>

However, upon inspection, the modal-sm class isn't been evaluated in my code as it is in the example, leading me to think that maybe it isn't included in the gem somehow, or am I missing something? The modal works in every other way aside the sizing.

like image 977
Jonathan Bender Avatar asked Feb 01 '14 20:02

Jonathan Bender


People also ask

How do I fix modal size?

Modal Size 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 and width of a Bootstrap modal?

in bootstrap you can use modal-sm, modal-lg for small and large size. Can you share your full code Or you can see this example, in this model width can be changable. w3schools.com/bootstrap/…

Does Bootstrap 3 have modals?

The Bootstrap modal component allows you to add a stylized dialog box to your website. Add a stylized dialog box to your website with the Bootstrap modal component.

How modal is implemented in Bootstrap?

To trigger the modal window, you need to use a button or a link. Then include the two data-* attributes: data-toggle="modal" opens the modal window. data-target="#myModal" points to the id of the modal.


2 Answers

I cannot simply update my bootstrap because of some breaking changes so what i did was added this to my site.css

@media screen and (min-width: 768px) {
  .modal-lg{
      width:900px;
  }

  .modal-sm{
      width:300px;
  }
}

I hope this helps someone else.

like image 186
jokab Avatar answered Oct 19 '22 14:10

jokab


Try latest Bootstrap - version 3.1.1

Bootstrap Bootstrap SASS

like image 8
Design by Adrian Avatar answered Oct 19 '22 15:10

Design by Adrian