vue-print.js 去除页眉页脚_Word几个小技巧,去页眉横线等
时间: 2023-08-18 13:10:08 浏览: 62
对于vue-print.js去除页眉页脚,可以通过以下几个小技巧实现:
1. 去除页眉和页脚
在打印样式中设置@page规则,将页眉和页脚的内容设为none,代码如下:
```css
<style type="text/css" media="print">
@page {
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
page-break-after: always;
page-break-inside: avoid;
page-break-before: auto;
@top-right {
content: none;
}
@bottom-right {
content: none;
}
}
</style>
```
2. 去除页眉横线
可以通过设置样式将页眉横线去除,代码如下:
```css
<style type="text/css" media="print">
@page {
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
page-break-after: always;
page-break-inside: avoid;
page-break-before: auto;
@top-center {
content: none;
}
}
</style>
```
3. 去除页脚横线
同样的,设置样式将页脚横线去除,代码如下:
```css
<style type="text/css" media="print">
@page {
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
page-break-after: always;
page-break-inside: avoid;
page-break-before: auto;
@bottom-center {
content: none;
}
}
</style>
```
注意:以上代码需要根据自己的实际需求进行调整。