I've been struggling with this today, as well – the problem is breaking out of the page margins, positioning elements relative to the page. I have two cases:
1. I'd like to add some visual guides to the page, just to check positioning and whatnot (actually, to check what's happening in problem #2 below)
The most promising solution seems to be something like what @mikeday mentioned here
http://www.princexml.com/bb/viewtopic.php?f=4&t=9062 which uses the
@top-left-corner{} selector which places an element at the 0, 0 coordinates of the page itself. Though, I'm still having a bit of trouble with this, I think I just need to fiddle with it some more, and will post code here if I can't get it working.
2. There are some pages where I want to 'float' an element vertically outside of the top margin. Example would be all pages have a 50mm top margin, but H1 elements are removed from the normal content flow and placed at 20mm from the top of the page. To complicate things, I'm running different left-right margins for left-right facing pages, so the x-axis position might become an issue. For now, I have something which looks like this:
@page{
margin-top:50mm;
}
H1{
float:left;
position:absolute;
top:-30mm;
}
Which is essentially the solution mentioned here. But this seems a bit of a hack, since I'm specifying a position relative to an arbitrary margin and not the page itself, and if, say, some particular page as a different margin-top value for some reason, then this all breaks and my element is positioned wrong.
@mikeday: might there be a need to extend the position property, adding something like:
position: static | relative | absolute | fixed | page-absolute | margin-absolute
where the
page-absolute and
margin-absolute values would position an element, as implied, explicitly in the coordinates of the page or the margins of the document.
It seems that this would be a 'legitimate' extension of standard CSS, since Prince has this additional page/margins dichotomy which is not present in a web browser viewport.