Forum Documentation

Running elements in header/footer

mrossi
Hi,

the way running elements are specified in Prince (at least according to the documentation) clashes with that of the current W3C Working Draft.

Here's an example. In comments the W3C way, outside comments the Prince way. The W3C way does not work with Prince. Besides, the element is not centered, despite it is placed in the bottom-center margin area.

@page {
margin: 2cm 3cm 2cm 3cm;
@bottom-center {
content: flow(footer);
/* content: element(footer);*/
}
}

div#anId {
flow: static(footer);
/* position: running(footer);*/
}


How do I deal with compatibility with W3C?

Thanks
mikeday
Prince does not support this new syntax yet. For compatibility, you can always use both. User agents will respect the properties they support, and ignore the properties they don't know about.
mrossi
Hello,

specifying both works provided the "older" syntax has no semantics in the newer spec. Luckily, that seems to be the case with the current WD :)

And what about the element not being centered by Prince?
mikeday
The element should take up the whole margin box, which means the element is be centered on the page, which should be visible if you give it a border. However, the content within the element will not be affected, so you may need to explicitly apply "text-align: center" to the element.

(The margin box will have "text-align: center" applied by default to generated content, but this does not apply to elements that are flowed to the margin box).
mrossi
I see your point. I was somehow mislead by the examples in the W3C working drafts.