使用HTML和CSS在第一张打印页面上显示不同的标题 [英] Displaying A Different Header on the First Printed Page with HTML and CSS

查看:176
本文介绍了使用HTML和CSS在第一张打印页面上显示不同的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过混合使用HTML和/或CSS在第一张打印的页上显示一个标头,然后在随后的每个打印页面?我知道@media print CSS标记仅在网站打印时显示某些内容,但这并不能使我在多个页面上具有不同的标题.

Is it possible, with any mix of HTML and/or CSS, to display one header on the first printed page and then display a different header on each subsequent printed page? I know about the @media print CSS tag to only display something when the site is printed, but that doesn't get me to having different headers on multiple pages.

感谢您的帮助,谢谢!

推荐答案

来自 http://css -discuss.incutio.com/wiki/Printing_Headers

如果要完整的CSS控制打印 页眉和页脚,您需要 等到浏览器实现支持 用于CSS3页面媒体候选 推荐.它明确提供 对于设施,但在相当 使用边距框以不同的方式.

If you want full, CSS-controlled print headers and footers, you'll need to wait until browsers implement support for the CSS3 Paged Media Candidate Recommendation. It explicitly provides for the facility but in a quite different way, using margin boxes.

可能是因为...

... CSS 职位描述:固定,[是]即 "...对于印刷媒体 类型,在每个 页,并且相对于 页..." [第9.3.1节]

... the CSS description of position: fixed, [is] namely "... In the case of the print media type, the box is rendered on every page, and is fixed with respect to the page ..." [Section 9.3.1]

...但是这篇文章说,这几天还行不通.

...but the article says it doesn't work as of these days.

,为您提供帮助,稍后文章说:

BUT, to help you, later the article says:

设置主体的上边距(对于 例如)仅适用于第一个 页面.

Setting a top margin on body (for example) will work only for the first page.

这篇关于使用HTML和CSS在第一张打印页面上显示不同的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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