Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Placing columns inside bootstrap modal

Tags:

I'm trying to get a Bootstrap model to have multiple columns inside it, however it does not appear to be working with my content appear vertically as opposed to in columns. My code is here:

<div class="modal fade" id="myModal" 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">Modal</h4>             </div>             <div class="modal-body">                 <div class="row">                     <div class="row-md-6">                         Left                     </div>                     <div class="row-md-6">                         Right                     </div>                 </div>              </div>             <div class="modal-footer">                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>                 <button type="button" class="btn btn-primary">Save changes</button>             </div>         </div>     </div> </div> 

I've found a few things around that solved this issue with Bootstrap 2, but they don't work with Bootstrap 3. I've also tried changing the row-md-6 to sm, xs etc, but no luck. Is it possible to do it in Bootstrap 3? Columns would be the most ideal thing for me, but should I avoid columns all together?

like image 360
Duncan Ogle Avatar asked Apr 17 '14 13:04

Duncan Ogle


People also ask

What is data dismiss modal?

modal-header class is used to define the style for the header of the modal. The <button> inside the header has a data-dismiss="modal" attribute which closes the modal if you click on it. The . close class styles the close button, and the . modal-title class styles the header with a proper line-height.

What will happen if more than 12 columns are placed within a single row while designing a Bootstrap grid layout?

Column wrapping If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.

How do you stop modal close on outside click?

When the Button is clicked, the HTML DIV is referenced using jQuery and its modal function is called along with properties data-backdrop: "static" and data-keyboard: false which disables the closing of the Bootstrap Modal Popup when clicked outside.


1 Answers

There is no row-md-* in Bootstrap, but col-md-* should work..

    <div class="modal-body">           <div class="row">             <div class="col-md-6">               Left             </div>             <div class="col-md-6">               Right             </div>           </div>     </div> 

http://www.bootply.com/130819

like image 151
Zim Avatar answered Sep 18 '22 23:09

Zim