CSS格式A4打印 [英] CSS formatting A4 print

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

问题描述

如何编写CSS样式以在打印时强制网页的特定页面边距,并且对IE和Firefox有效?

How can I code a CSS style to force specific page margins for a web page when printing, and be valid for IE and Firefox ?

推荐答案

使用介质类型打印(@media打印)。

Use the media type "print" (@media print).

不要设置固定宽度和最大宽度。使内容液体。如果您使用(px,em,pt,cm)指定任何一个,您将始终遇到一个或另一个问题,因为不同的浏览器会添加不同的边距。

Don't set a fixed width nor a maxwidth. Make the content fluid instead. If you specify any with (px, em, pt, cm) you will always run into one or the other problem because different browsers add different margins.

A3,这不是你的关注。您的文档不在乎。用户可以在任何纸张上打印您的文档,因为您的内容是流畅的。

A4, letter, A3, it's not your concern. Your document doesn't care. The user can print your document on whatever paper he has available because your content is fluid.

查找有关css的一些提示,以便在此处打印

这篇关于CSS格式A4打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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