CSS Print stylesheet - padding on the second page

我们两清 提交于 2019-12-22 08:23:20

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/18173423/css-print-stylesheet-padding-on-the-second-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!