How to make page border in print CSS for every single page

后端 未结 3 1488
臣服心动
臣服心动 2020-12-11 16:18

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 cod

3条回答
  •  误落风尘
    2020-12-11 16:37

    The best way is putting a fixed div in a page. The important thing is that you should not put any content inside it. It works seamlessly with multi-pages:

    
    
      
    
    
      
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    sdf
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    111
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222
    222

提交回复
热议问题