通过 CSS 打印比例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5717800/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 00:19:27  来源:igfitidea点击:

Print Scale by CSS

cssprinting

提问by dotnetN00b

On IE 8 and Firefox (3.6 and 4), if you go to Print Preview, you adjust the Print Scale by a a percentage or use Shrink to Fit. Does CSS have a property like scale:50%; or something to adjust the print scale?

在 IE 8 和 Firefox(3.6 和 4)上,如果您转到“打印预览”,则可以按百分比调整打印比例或使用“缩小以适合”。CSS 是否有类似 scale:50%; 的属性?或调整打印比例的东西?

回答by Waruna Manjula

<style type="text/css" media="print">

body {
  zoom:75%; /*or whatever percentage you need, play around with this number*/
}

</style>

回答by dotnetN00b

Since zoom or -ms-zoom doesn't work the way I expected it to on IE8, I ended up fiddling with the font-size and tr sizes. Hopefully MS makes a zoom that works like the Print Scale/Size functionality in the Print window from the browser.

由于 zoom 或 -ms-zoom 在 IE8 上无法按我预期的方式工作,因此我最终摆弄了 font-size 和 tr 大小。希望 MS 进行缩放,就像浏览器中打印窗口中的打印比例/大小功能一样。