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屋!
查看全文