有什么办法改变的JavaScript或CSS浏览器打印设置 [英] Is there any way to change Browser print settings by Javascript or CSS

查看:178
本文介绍了有什么办法改变的JavaScript或CSS浏览器打印设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过JavaScript或CSS改变浏览器的打印设置。结果
具体来说,我需要清除的页眉和页脚

I want to change print settings of browser by javascript or CSS.
Specifically I need to clear Headers and Footers.

例如在GoogleChrome当我preSS <大骨节病> CTRL + P 出现在打印对话框有一个选项叫页眉和页脚,默认情况下已经检查在我的浏览器(Chrome版本30.0.1599.101米)。

For example in GoogleChrome when I press Ctrl+p the print dialog appears and there is an option named "Headers and Footers" that by default has checked in my browser (Chrome version 30.0.1599.101 m).

1 即可。我并不需要跨浏览器的解决方案。这足以让我,如果我能找到在一个浏览器,如谷歌Chrome或Firefox或IE浏览器的解决方案。

1. I don't need a cross-browser solution. It's enough for me if I could find a solution in one browser such as Google Chrome or firefox or IE.

2 。我知道这是可能通过使用ActiveX,但我不希望使用的ActiveX。

2. I know that this is possible by using ActiveX but I don't want to use ActiveX.

推荐答案

您可以隐藏通过使用CSS @media打印querys页眉/页脚...

you can hide your header/footer by using css @media print querys...

W3Schools的

CSS-印刷媒体查询

这篇关于有什么办法改变的JavaScript或CSS浏览器打印设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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