Disabling browser print options (headers, footers, margins) from page?

后端 未结 9 931
生来不讨喜
生来不讨喜 2020-11-22 08:34

I have seen this question asked in a couple of different ways on SO and several other websites, but most of them are either too specific or out-of-date. I\'m hoping someone

9条回答
  •  迷失自我
    2020-11-22 08:53

    This worked for me with about 1cm margin

    @page 
    {
        size:  auto;   /* auto is the initial value */
        margin: 0mm;  /* this affects the margin in the printer settings */
    }
    html
    {
        background-color: #FFFFFF; 
        margin: 0mm;  /* this affects the margin on the html before sending to printer */
    }
    body
    {
        padding:30px; /* margin you want for the content */
    }
    

提交回复
热议问题