2

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);
 }
}
AfromanJ
3,9323 gold badges19 silver badges34 bronze badges
asked Feb 26, 2014 at 13:39
6
  • soo... how about posting some of your code? Commented 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/@page Commented 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 :( Commented Feb 26, 2014 at 13:45
  • dev.w3.org/csswg/css-page/#at-page-rule Commented Feb 26, 2014 at 13:45
  • @Resource-guru.com I read it, doesn't work. Commented Feb 26, 2014 at 13:48

1 Answer 1

2

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);
 }
}

More info

answered Feb 27, 2014 at 10:45
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.