javascript怎么去掉页眉页脚
时间:2022-02-11 16:02
javascript去掉页眉页脚的方法:首先使用javascript中的window.print()功能进行当前页面的打印;然后使用css控制布局去掉页眉页脚即可。 本文操作环境:windows7系统、javascript1.8.5版、Dell G3电脑。 javascript怎么去掉页眉页脚? 写在前面 今天的开发遇到了使用window.print()功能进行当前页面打印的功能,因为页脚左边部分显示了url,这是不能存在的,已解决,写在这里。 正文 很多网上的方法都是不能用的,最后我找到一个使用css控制布局去掉页眉页脚的方法 最后 亲测,谷歌,ie都解决 【推荐学习:javascript高级教程】 以上就是javascript怎么去掉页眉页脚的详细内容,更多请关注gxlsystem.com其它相关文章!<style> @page { size: auto; /* auto is the initial value */ margin: 0mm; /* this affects the margin in the printer settings */ }
</style>