HTML:
<input type="button" onclick="printDiv('Invoice')" value="print a div!"/>
<div id="Invoice">
<!-- Some Content-->
</div>
CSS:
<head><style type="text/css" media="print">
@page{
margin-right : 0;
margin-left : 0;
margin-top : 1in;
margin-bottom :1in;
}
</style>
</head>
当我单击按钮打印预览打开但不应用边距。