I have something like the following in my CSS, in order to be friendly to the edit styles
bookmarklet, which doesn't support the media
attribute of the style
tag, so, I explicitly use @media print
for the whole style.
@media print {
@page {
margin: 1cm;
margin-top: 12mm;
size: portrait;
}
body {
font: 9.3pt "Hoefler Text", "Franklin Gothic Book", sans-serif;
max-width: 80em;
border: 0;
margin: 0 auto;
padding: 0;
}
/* more stuff here */
}
However, it would seem like http://jigsaw.w3.org/css-validator/#validate_by_input doesn't like this, producing the following errors:
7 Parse Error @page { margin: 1cm; margin-top: 12mm; size: portrait; }
16 Parse Error /* more stuff here */ }
However, if I move the @page
rule to outside of @media print
, then no errors are reported.
Am I doing something wrong, or is this a bug in the validator?
According to MDN, browser support is pretty new, SO confirms, even though this has been part of the original CSS2 recommendation from 1998, pretty much unchanged.