When a page in my application is printed, I'd like to hide the side navigation and expand the width of the main content to be a full 12 columns (I'm using Bootstrap 3).
Here's the current html/css.
<div class="row">
<div class="col-md-3 side-navigation hidden-print">
...
</div>
<div class="col-md-9">
...
</div>
</div>
What's the Bootstrap idiomatic way to expand the second column's width when printed?
It's possible, with additional css rules:
Add class print-9 to your col-sm-9 class. Then add this to your css:
@media print {
.print-9 { width: 100% }
}
Expanding upon Andrey's answer. To account for offsets, like col-offset-1, you need to set the margin-left to 0.
@media print {
.col-print-12 {width: 100%; margin-left:0px;}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With