How to print an entire A4 HTML page

I took the template from w3-schools , did some research and tried this by looking at this question :

@page {
   size: 7in 9.25in;
   margin: 27mm 16mm 27mm 16mm;
}

I inserted this print code

<script>
  $(document).ready(function()
  {
    window.print();
  });
</script>

And got this result:

current output

But that I do not want. I do not want extra spaces around divs. It should be printed as page A4, for example:

enter image description here

What should I do to achieve this?

PS: Before unleashing the frustration, I am a pure backend developer. My partner, who is a third-party developer, has been sick for several days. Sorry and thanks :)

+4
source share
1 answer

CSS. :

@page {
  size: 7in 9.25in;
  margin: 0mm 0mm 0mm 0mm;
}

... "0 " , , 1 , 2 ..

4 ( 0 ) , , .

, , 0 .

+1

Source: https://habr.com/ru/post/1678988/


All Articles