@media print ... page size messed up in print preview?, How to set a div to be exactly the size of the page when printing? |
@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 |
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. |
Lo-Fi Version | Time is now: 25th April 2024 - 02:59 AM |