Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 4 CSS causing Chrome's print "Layout" to disappear

I want my website users to be able to print pages in either portrait or landscape mode.

When printing from Google Chrome using Bootstrap 3.3.7, the Chrome print settings has a Layout option. Simply changing the css/js to 4.0.0, the Chrome print settings no longer has the Layout option. I suspect this has something to do with one of these CSS directives:

@page
@media
like image 519
paultechguy Avatar asked Feb 27 '18 21:02

paultechguy


2 Answers

I was able to fix this by adding this CSS:

@page {
    size: auto;
}
like image 92
paultechguy Avatar answered Nov 08 '22 02:11

paultechguy


In Bootstrap 4.5 below code worked do not use ;

@media print { @page {size: auto !important} }
like image 5
yeshwanthkv Avatar answered Nov 08 '22 04:11

yeshwanthkv