I've got some question about @page css media tag.
So I read some documentation written by w3 and Microsoft, but anyways no effect with it.
Following the link http://msdn.microsoft.com/en-us/library/ie/ms530841(v=vs.85).aspx when I use the parameters like they say, it does not work for me.
I even can't find any other example how to numerate pages in browser print media.
Can anyone help me?
Updated
here is my snippet for it. Margins work correctly, but counting dont.
@page {
margin-top: 15mm;
margin-bottom: 25mm;
margin-left: 30mm;
margin-right: 30mm;
@bottom-center {
content: "page " counter(page);
}
}
-
soo... how about posting some of your code?slynagh– slynagh2014年02月26日 13:40:38 +00:00Commented Feb 26, 2014 at 13:40
-
Never, ever use Microsoft documentation. Always use the actual spec or something from Mozilla: developer.mozilla.org/en-US/docs/Web/CSS/@pageRob– Rob2014年02月26日 13:42:32 +00:00Commented Feb 26, 2014 at 13:42
-
1@Rob it required by client that it must work only for IE and they don't care about all other browsers. That's problem :(nikoloza– nikoloza2014年02月26日 13:45:45 +00:00Commented Feb 26, 2014 at 13:45
-
dev.w3.org/csswg/css-page/#at-page-ruleSahil Popli– Sahil Popli2014年02月26日 13:45:52 +00:00Commented Feb 26, 2014 at 13:45
-
@Resource-guru.com I read it, doesn't work.nikoloza– nikoloza2014年02月26日 13:48:43 +00:00Commented Feb 26, 2014 at 13:48
1 Answer 1
CSS3 Counters have to be reset before they can be used
Try This once
@page {
margin-top: 15mm;
margin-bottom: 25mm;
margin-left: 30mm;
margin-right: 30mm;
@bottom-center {
counter-increment: page;
counter-reset: page 1;
content: "page " counter(page);
}
}
answered Feb 27, 2014 at 10:45
Sahil Popli
2,01315 silver badges21 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default