Bootstrap grid for printing

前端 未结 11 2225
长情又很酷
长情又很酷 2020-12-23 11:25

I would like to design a report page with a different layout for printing to mobile. I am using bootstrap v3. It seems the grid can\'t differentiate between the two as the b

11条回答
  •  旧时难觅i
    2020-12-23 12:05

    I had a similar problem, for me the easiest solution was to manually modify the width for elements I wanted to appear differently when printed (and I added a specific class -in my case: title-container, details-container for those, along the col-xs-6 etc.).

    For example:

    Some stuff
    Some more stuff
    @media print { .title-container { width: 360px; float: left; } .details-container { width: 300px; float: right; } }

    In my case I needed a column to be floated on the right, one to the left, thus the floats... You could set in your custom css the width also for .col-xs-6 etc. just a quick and dirty solution, but did the job for a page where I needed this...

提交回复
热议问题