4 ms·
@media print { @page { @bottom-center { content: counter(page) } } works with https://pagedjs.org https://pagedjs.org
by tingletech 3y ago
@media print {
@page {
@bottom-center { content: counter(page) }
}
works with https://pagedjs.org https://pagedjs.org
- SparkyMcUnicorn 3y agoAnd it's not just a Paged.js thing. No "hacks" necessary. https://www.w3.org/TR/css-page-3/#page-based-counters https://www.w3.org/TR/css-page-3/#page-based-counters
- jamesfinlayson 3y agoWhat browser does it work in natively? I tried this a couple of years ago and a few people claimed that it worked in kiosk mode for Chrome but I couldn't get it to work in any browser.
- SparkyMcUnicorn 3y agoIt looks like it should be available in all major browsers. https://developer.mozilla.org/en-US/docs/Web/CSS/@page#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/CSS/@page#brows... That said, I've always used paged.js with its polyfills to fill in other gaps. So maybe there's something I'm unaware of.
- jamesfinlayson 3y ago@page probably works for some things but when I tried to do page numbers it definitely didn't. I ended up hacking something together (absolute positioning a number every ~700px or whatever so it sat on the same place each page).
- tingletech 3y agopaged.js is a polyfill that implements this. I'm not aware of any browser that support this. Why do you call paged.js a "hack"?
- SparkyMcUnicorn 3y agoMy quoted "hacks" was in response to the parent "impossible with css hacks". I'm a big fan of paged.js.