CSS指定打印时的全页宽度? [英] CSS to specify full page width at printing?

查看:68
本文介绍了CSS指定打印时的全页宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html页面,该页面打印得很好,这要归功于特定于打印的样式,但有一件事情:它不使用页面的整个宽度.换句话说,我希望页面可以缩放以填充页面.

I have an html page that is printed pretty well thanks to print specific styling except for one thing : it does not use the full width of the page. In other words, I would like the page to be scaled to fill the page.

是否可以使用CSS样式获得该结果?

Is it possible to obtain that result using css styles ?

推荐答案

我知道在IE中您无法控制诸如通过打印对话框设置的默认页边距之类的操作.这些通常为2厘米,只能由实际用户在打印对话框中覆盖.除了将主容器(html,body等)设置为width:100%并将margin和padding设置为0之外,您还可以做其他事情.请记住,尽管在CSS中为html/body设置的边距位于用户的打印设置中定义的页面打印区域之内.

I know in IE you cannot control things such as the default page margins that are set via the print dialog. These are usually 2cm and can only be overriden by the actual user in the print dialog. Other than that setting the main containers (html, body, etc.) to be width:100% and margin and padding to be 0 is the only other thing that you can do. Remember though that the margin set in CSS for html/body are within the print area of the page as defined in the print settings for the user.

这篇关于CSS指定打印时的全页宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆