Last post May 02, 2018 05:22 PM by PatriceSc
May 02, 2018 04:15 PM|simflex|LINK
I have a one page document that when printed, has both header and URL at bottom of page.
I googled and discovered I could use the following CSS to get rid of the URL at head and bottom of page.
<style type="text/css" media="print">
size: auto; /* auto is the initial value */
margin: 0; /* this affects the margin in the printer settings */
margin: 0; /* this affects the margin on the html before sending to printer */
border: solid 0px blue ;
margin: 10mm 15mm 10mm 15mm; /* margin you want for the content */
However, the only way it works is if I set the printer to use "actual" instead "fit page" options.
The page uses <TABLE> properties.
Am I missing something?
Thanks in advance
May 02, 2018 05:22 PM|PatriceSc|LINK
It is appended by the browser when printing a page depending on user controlled settings. Try maybe
https://developer.mozilla.org/en-US/docs/Web/CSS/%40page/size to force a page size and see if it makes a difference ?
It tend myself to avoid this kind of clever hacks or at least to not apply them first as you'll likely always run into some corner case (it works for all users, if you plan to print multiple pages it still works in this situation ?)
My default approach would be to have a link on my printing page to inform users about how to use the printing dialog to get rid of headers and footers...