<html>
<head>
<title>打印测试</title>
/*使用css控制布局去掉页眉页脚的方法*/
<style media="print">
@page {
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
}
/*使用css控制布局去掉页眉页脚的方法 ,ie 360 谷歌 都支持 */
</style>
</head>
<body>
<span id='div1'>把要打印的内容放这里</span>
<a href="javascript:printme();" >点击打印</a>
<script language="javascript">
function printme()
{
document.body.innerHTML=document.getElementById('div1').innerHTML;
window.print();
}
</script>
</body>
</html>