Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 - Print layout and breaks after each grid column

If you take this example (view it here: http://www.bootply.com/93816)

<div class="container">   <div class="row">     <div class="col-md-6">Column1</div>     <div class="col-md-6">Column2</div>   </div> </div> 

When you do a print preview of the generated page, it seems to cause the columns to stack/break (as if the float is removed) instead of displaying them in the usual grid layout.

I've had a look at the @media print sections of bootstrap.css and I can't see anything related to div that would cause that to happen.

Does anyone know how to avoid this?

like image 914
AndyC Avatar asked Nov 13 '13 08:11

AndyC


People also ask

How do I split 3 columns in Bootstrap?

Three Equal ColumnsUse the . col class on a specified number of elements and Bootstrap will recognize how many elements there are (and create equal-width columns). In the example below, we use three col elements, which gets a width of 33.33% each.

What is offset 3 in Bootstrap?

offset-md-3 which will offset the desired column element with 3 columns to the right from its default position on medium screen sizes and above. . offset classes always shifts its content to the right. This all stuff produced results .

Why Bootstrap divided the grid into 12 imaginary columns?

Well, a 12-column layout was how Bootstrap developed their layout technique. It is more effective because the layout was only intended to grow as large as the body of the page and shrink as small as a few words.

How do I change Bootstrap 3 column order on mobile layout?

By using col-lg-push and col-lg-pull we can reorder the columns in large screens and display sidebar on the left and main content on the right.


1 Answers

Bojangles comment got me in the right direction, so I'll answer my own question.

Using the 'xs' size grid columns, which according to http://getbootstrap.com/css/#grid-options is for "Extra small devices Phones (<768px)", Bootstrap happily prints as expected.

<div class="container">   <div class="row">     <div class="col-xs-6">Column1</div>     <div class="col-xs-6">Column2</div>   </div> </div> 
like image 180
AndyC Avatar answered Oct 13 '22 01:10

AndyC