使用 Adobe Indesign 可以获得以下结果:
我尝试用 css 得到相同的结果
<style type="text/css" media="print">
@page
{
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
}
body
{
background-color:#FFFFFF;
border: solid 1px black ;
margin: 0px; /* this affects the margin on the content before sending to printer */
}
</style>
但不可能将边距设置为 0。我总是在 4 边有边距:
同样的情况,4 边有一些小白边...怎么了?
如有任何帮助,我们将不胜感激。 JsFiddle:https://jsfiddle.net/L63dc1yd/
最佳答案
我认为你可以用CSS3 Media Query解决这个问题.
@media print {
html,body {
margin: 0;
}
}
关于html - 使用 css(使用 chrome)禁用打印机默认边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34913242/