Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap Prints In XS

I am using Twitter Bootstrap 3 but when I go to print my webpage (via File > Print) it's printing the page in XS (Mobile view), how do I force it to use and print in MD (Desktop view).

It only works fine in IE versions 9 and below. Every other browser and IE 10+ have the issue.

like image 739
murday1983 Avatar asked Oct 29 '14 10:10

murday1983


1 Answers

.col-xs-X is outside media queries that is why it prints. All columns are the same size: 100/12 = 8.333333% so .col-lg-6 and .col-sm-6 and .col-xs-6 and .col-md-6 are all 50% of the .container/.container-fluid.

To get your printed page to print the columns, you would add a print media query:

@media print { 
    .container {
        max-width: none!important;
        width: 100%!important;
        padding-left: 0;
        padding-right: 0;
    }
    .row {
        margin-left: -1%;
        margin-left: -1%;
    }
    [class*="col-"] {
        float: left;
        padding-left: 1%;
        padding-right: 1%;
    }
    .col-sm-12,
    .col-md-12,
    .col-lg-12 {
        width: 100%
    }
    .col-sm-11,
    .col-md-11,
    .col-lg-11 {
        width: 91.66666667%
    }
    .col-sm-10,
    .col-md-10,
    .col-lg-10 {
        width: 83.33333333%
    }
    .col-sm-9,
    .col-md-9,
    .col-lg-9 {
        width: 75%
    }
    .col-sm-8,
    .col-md-8,
    .col-lg-8 {
        width: 66.66666667%
    }
    .col-sm-7,
    .col-md-7,
    .col-lg-7 {
        width: 58.33333333%
    }
    .col-sm-6,
    .col-md-6,
    .col-lg-6 {
        width: 50%
    }
    .col-sm-5,
    .col-md-5,
    .col-lg-5 {
        width: 41.66666667%
    }
    .col-sm-4,
    .col-md-4,
    .col-lg-4 {
        width: 33.33333333%
    }
    .col-sm-3,
    .col-md-3,
    .col-lg-3 {
        width: 25%
    }
    .col-sm-2,
    .col-md-2,
    .col-lg-2 {
        width: 16.66666667%
    }
    .col-sm-1,
    .col-md-1,
    .col-lg-1 {
        width: 8.33333333%
    }
}
like image 77
Christina Avatar answered Sep 27 '22 20:09

Christina