CSS打印样式表 - 第二页上的填充 [英] CSS Print stylesheet - padding on the second page

查看:369
本文介绍了CSS打印样式表 - 第二页上的填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个文档的打印样式表,它将运行到几页。我想让每一页在顶部有一个公司标志,顶部填充5厘米,所以我这样做:

I'm designing a print stylesheet for a document which will run to a few pages. I want every page to have a company logo at the top, and top padding of 5 centimeters, so I did this:

body {
 background:url(logo.png) no-repeat center top;
 padding-top:5cm;
}

标志根据要求完全显示在每个页面上。但是顶部填充只显示在第一页上,后续的每一页都有填充顶部零。

The logo appears on each page as requested, perfectly. But the top padding only appears on the FIRST page, and every subsequent page has padding-top of zero.

我做错了什么?如何在每个页面上获得顶部填充?

Am I doing something wrong? How can I get the top padding on EVERY page?

推荐答案

这可能是因为 padding 相对于 body 标记计数。在正文标记之后使用 padding-top style和immediate wrapper元素。

This may be because padding is counted relative to body tag. Use padding-top style with immediate wrapper element after body tag.

这篇关于CSS打印样式表 - 第二页上的填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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