The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> @media print ... page size messed up in print preview?, How to set a div to be exactly the size of the page when printing?
wombatvvv
post Nov 5 2020, 04:46 PM
Post #1





Group: Members
Posts: 1
Joined: 5-November 20
Member No.: 27,618



I've been messing around with this for hours now and it's driving me nuts.

Unless I'm misunderstanding something, this should be straightforward:

CODE
      
div.A4.page {
          width: 200mm;
          height: 287mm;
          margin: 0;
          border: 5mm solid red;
          padding: 0;
      }


An A4 page is 210mm wide and 297mm high. So set to 200mmx287mm with a 5mm border, that should take up the entire page if I do a print preview (set to "print to PDF" with no margins in the print dialog).

However, for some reason it's slightly too small. If I set the border to 10mm, then it seems wide enough but not tall enough.

What's going on here? Am I missing something obvious or is the browser implemenation just bad? (Chromium).

Any help appreciated.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 05:03 PM