如何在每个页面的打印CSS的页边框 [英] How to make page border in print CSS for every single page

查看:446
本文介绍了如何在每个页面的打印CSS的页边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很长的HTML要打印。页面准备好打印,但我需要边界每一页。我添加了 body {border:2px#666 solid; padding:5px; } 在CSS代码。 HTML视图是好的,但打印视图不是。因为border-bottom没有显示第一页,border-top没有显示所有其他页面。

I have a long HTML to print. Page is ready for printing but I need to border every single page. I added body { border:2px #666 solid; padding:5px; } in CSS code. HTML view is nice but print view is not. Because border-bottom is not showing first page and border-top is not showing all other pages.

我希望,我可以解释我想要的。我被搜索,仍在寻找解决方案。我认为这很容易。但stil没有找到。

I hope, I can explain what I want. I'm searched and still searching for solution. And I think it's easy trick. But stil not found.

推荐答案

尝试这将帮助你:它将在全屏上创建边框。

Try this it will help you : It will make border on full screen.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
  <title>Border around content</title>
  <style type="text/css">
    * {
      margin: 0;
      padding: 0;
    }

    html, body {
      height: 100%;
      overflow: hidden;
    }

    #wrapper {
      position: absolute;
      overflow: auto;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      border: 5px solid red;
    }
  </style>
</head>
<body>
  <div id="wrapper">
  </div>
</body>
</html>

这篇关于如何在每个页面的打印CSS的页边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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