Thomas 'PointedEars' Lahn wrote:
Andrew Poulos wrote:
>[...] how do I set the style of paged media i.e. the @page rule?
Specifically I need to set this CSS:
@page {
size: landscape;
margin: 10%;
}
var s = document.createElement("style");
if (s)
{
s.type = "text/css";
s.appendChild(
document.createTextNode(
"@page { size: landscape; margin: 10%; }"));
document.getElementsByTagName("head")[0].appendChild(s);
}
Sadly:
IE 7 complains that
Error: Unexpected call to method or property access.
At the "s.appendChilde" line.
FF 3 gives the error:
Unrecognised at-rule or error parsing at-rule '@page'.
Opera 9.5 is happy (no error and the page prints in landscape).
Safari ignores it (no error but the page prints in portrait).
Chrome ignores it (no error but the page prints in portrait).
Looking it a bit more it seems that the @page rule may not be supported.
It was dropped from CSS 2.1 :-(
Andrew Poulos