Printing page with bootstrap 3

前端 未结 6 1388
死守一世寂寞
死守一世寂寞 2020-12-08 02:50

I\'ve been looking through a lot of answers here on stackoverflow that semi-cover what I\'m wondering about, but haven\'t found anything that worked for me.

I unders

6条回答
  •  攒了一身酷
    2020-12-08 03:29

    It would be helpful to provide a JSBin. Anyway, since I had this layout in JSBin with col-sm-(asterisk), you can just change all the -sm- to -xs- in between the print media query. All percentages are the same at every breakpoint, so changing sm to xs will print that and ignore the other col-(asterisk) classes. Ahh, I read the post now, you'll need to change all the col-sm to col-md in this and then use !important, that should do it. The xs col are outside media queries, so that's why this is happening.

    http://jsbin.com/AzICaQes/5

    @media print {
    
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
      float: left;
    }
    .col-sm-12 {
      width: 100%;
    }
    .col-sm-11 {
      width: 91.66666666666666%;
    }
    .col-sm-10 {
      width: 83.33333333333334%;
    }
    .col-sm-9 {
      width: 75%;
    }
    .col-sm-8 {
      width: 66.66666666666666%;
    }
    .col-sm-7 {
      width: 58.333333333333336%;
    }
    .col-sm-6 {
      width: 50%;
    }
    .col-sm-5 {
      width: 41.66666666666667%;
    }
    .col-sm-4 {
      width: 33.33333333333333%;
     }
     .col-sm-3 {
       width: 25%;
     }
     .col-sm-2 {
       width: 16.666666666666664%;
     }
     .col-sm-1 {
      width: 8.333333333333332%;
     }
    
      }
    

提交回复
热议问题