I'm trying to create styles that match label sheets exactly. My general strategy is to set the body to have no margin, set the page size exactly, and have an inner div per page print_layout that also matches 8½″ × 11″ (in this case).
The problem is that setting the page margin to 0 doesn't actually set it to precisely zero.
@page {
size: 8.5in 11in;
margin: 0;
}
My understanding after looking around a bit is that you can't truly set a page margin to zero and expect the results to be zero. What I'd like is:
1) A way in javascript to get the minimum print margin so I can compensate with precise negative margin's and padding of my inner styles.
2) A way to override this setting so I can get a true zero margin (note: I have no need to print edge-to-edge, I just need the styling to be sized to the page)
3) Some other solution I'm not thinking of yet.
Below is a screen capture of the print preview in edge-dev. The margin is set to zero like indicated above. I've changed the background of my inner div and turned on the background graphics settings to show visually the size of the body (and inner div).