Bootstrap 4 CSS导致Chrome的打印“布局"消失 [英] Bootstrap 4 CSS causing Chrome's print "Layout" to disappear
本文介绍了Bootstrap 4 CSS导致Chrome的打印“布局"消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的网站用户能够以纵向或横向模式打印页面.
I want my website users to be able to print pages in either portrait or landscape mode.
使用Bootstrap 3.3.7从Google Chrome浏览器进行打印时,Chrome浏览器的打印设置具有版式选项.只需将css/js更改为4.0.0,Chrome打印设置就不再具有布局"选项.我怀疑这与以下CSS指令之一有关:
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
推荐答案
我能够通过添加以下CSS来解决此问题:
I was able to fix this by adding this CSS:
@page {
size: auto;
}
这篇关于Bootstrap 4 CSS导致Chrome的打印“布局"消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文