Remove the default browser header and footer when printing HTML

孤者浪人 提交于 2019-11-26 21:02:54

Google Docs is now skirting around this issue by generating a PDF version of your document.

If you are using Chrome, it will automatically open the PDF in a new tab and pop up the print dialog. Other browsers will prompt you to download the resultant file (which is not necessarily obvious behavior).

While I don't find this to be an elegant solution, one should be able to recreate this fairly easily using most existing web technologies.

These a usually browser specific print settings.

In IE & FireFox for example you can go into page setup and change the header and footer details for printing.

I don't think this can be controlled by the web page itself.

You can employ an activeX-plugin if your users uses IE, an example is scriptX from Meadroid: http://www.meadroid.com/sx_intro.asp

For future reference:

@page {
  margin: 0;
}
@media print {
  footer {
    display: none;
    position: fixed;
    bottom: 0;
  }
  header {
    display: none;
    position: fixed;
    top: 0;
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!