Referring to the full fiddle at: http://jsfiddle.net/XT92a/
@page {
margin: 1in;
}
@page :first {
margin: 2in 1in 3in 3in;
}
I expect the above rule to make the first printed page have certain margins and all other pages have 1 inch margins.
Instead, I get the following in Chrome's print preview (accurate to the printed output). The margins are different on the non-first pages, but they are not correct. Commenting out the :first margin
rule allows the non-first pages to print with the correct layout, but of course, the first page is also affected.
Mozilla's documentation seems to me to claim that Chrome supports this properly. And clearly Chrome reacts, but not correctly. I'd reference Chrome documentation if I could, but Google sucks at documentation! (Is there a google equivalent of the MDN? I can't find it.)
It's strange to me that I can't find mention of this problem elsewhere, if Chrome should have supported this since version 2.0 and that print layouts are such a huge PITA.
Am I doing it wrong? Is there a robust workaround? I've tried @page:first
(no space), setting margin values independently trbl style and individually, and swapped the order of the rules in the style declarations. No effect.
:first
-specific page. I didn't see that was a link. But see that the:first
-specific page shows support in IE 8.0, but that isn't true. In fact, it seems to act just like Chrome which is interesting. Perhaps I'm using it wrong? – Welles