problem with @media print { @page {..} }

Hi,

I think that the following snippet of code should be valid CSS2:

======================
@media print {
@page {
	 margin: 5%;
  }
}
======================

but the validator does not agree:

     * Line: 5

       Parse Error - @page { size: auto; margin: 5%; }
     * Line: 6

       Parse error - Unrecognized : }



I also tried to test a similar snippet from the sample style sheet  
(for HTML 4.0) that could be found in the CSS2 Specification
(Appendix A):


======================
@media print {
   @page         { margin: 10% }
   H1, H2, H3,
   H4, H5, H6    { page-break-after: avoid; page-break-inside: avoid }
   BLOCKQUOTE,
   PRE           { page-break-inside: avoid }
   UL, OL, DL    { page-break-before: avoid }
}
======================

and it also fails, with similar error messages.


Apparently the validator has a problem with @page nested inside an  
@media print {...} block.
I cannot say about CSS2.1, but this should be legal in CSS2, given  
that such constructs were in the official specification itself.  Or,  
maybe am I missing something?


Thanks a lot.

Giovanni Cutolo





========================================
Dr. Giovanni Cutolo
Dipartimento di Matematica e Applicazioni "R. Caccioppoli"
Universita` degli Studi di Napoli "Federico II"
tel.: +39 081675695
fax (not personal): +39 0817662106
http://www.dma.unina.it/~cutolo/
e-mail:  cutolo@unina.it

Received on Monday, 20 February 2006 15:07:51 UTC