【js、vue-print-nb】js 在Chorme中打印页面去掉页眉页脚

js或者vue-print-nb插件在chorme调用打印是都会带上 页眉页脚及时间。

在chorme中可以手动设置 打印是否要页眉页脚,如果不想手动打印时设置可以参考用css 控制:

参考:https://stackoverflow.com/questions/1960939/disabling-browser-print-options-headers-footers-margins-from-page

@page{
    size:  auto;   /* auto is the initial value */
    margin: 3mm;  /* this affects the margin in the printer settings */
  }

  html{
    background-color: #FFFFFF;
    margin: 0px;  /* this affects the margin on the html before sending to printer */
  }

  body{
    border: solid 1px blue ;
    margin: 10mm 15mm 10mm 15mm; /* margin you want for the content */
  }
发布了110 篇原创文章 · 获赞 36 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/wjx_jasin/article/details/100153326