Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 modal responsive

Tags:

I have a modal but it's not resizing on smaller screens ( tablets, etc ). Is there a way to make it responsive ? Couldn't find any information on bootstrap docs. Thanks

I update my html code: ( its inside a django for loop )

    <div class="modal fade " id="{{ p.id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >       <div class="modal-dialog modal-lg">         <div class="modal-content">           <div class="modal-header">             <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>             <h4 class="modal-title" id="myModalLabel">Producto</h4>           </div>           <div class="modal-body">             <h5>Nombre : {{ p.name}}</h5>                  </div>           <div class="modal-footer">             <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>            </div>          </div>       </div>     </div> 

I have these css settings:

.modal-lg {   max-width: 900px; } @media (min-width: 768px) {    .modal-lg {     width: 100%;   }  } @media (min-width: 992px) {   .modal-lg {     width: 900px;   } } 
like image 314
jesicadev18 Avatar asked May 31 '14 21:05

jesicadev18


People also ask

Is Bootstrap modal responsive?

Bootstrap 5 Modal component. Responsive popup window with Bootstrap 5. Examples of with image, modal position i.e. center, z-index usage, modal fade animation, backdrop usage, modal size & more. Modal is a responsive popup used to display extra content.

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.

Do Bootstrap modals work on mobile?

Bootstrap modals don't work correctly on Android and iOS. The issue tracker acknowledges the problem but does not offer a working solution: Modals in 2.0 are broken on mobile. The screen darkens but the modal itself is not visible in the viewport.


1 Answers

From the docs:

Modals have two optional sizes, available via modifier classes to be placed on a .modal-dialog: modal-lg and modal-sm (as of 3.1).

Also the modal dialogue will scale itself on small screens (as of 3.1.1).

like image 197
PM 77-1 Avatar answered Oct 14 '22 04:10

PM 77-1