简体   繁体   中英

@page css media does not work for Chrome and IE

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM