Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select last page #1222

Open
Thihup opened this issue Sep 14, 2023 · 3 comments
Open

Select last page #1222

Thihup opened this issue Sep 14, 2023 · 3 comments

Comments

@Thihup
Copy link

Thihup commented Sep 14, 2023

I'd like to use a selector of the last page, but I don't know how to do it.

Is using @page :last the correct syntax?

@MurakamiShinyu
Copy link
Member

MurakamiShinyu commented Sep 15, 2023

CSS Paged Media -- Page selectors defines @page :first but not @page :last. Probably this is because @page :last is not very easy to implement, that is, whether a page becomes the last page cannot be determined until a whole document formatting is finished, and changing the page style for the last page may cause a page overflow and an extra page break (e.g., if the last page's page area is smaller than normal pages), and the last page style has to be canceled, but again it becomes the last page. To prevent this loop, an extra blank page may need to be added in such cases.

@Thihup
Copy link
Author

Thihup commented Sep 15, 2023

Also, the CSS Generated Content for Paged Media Module spec specifies the :nth(AnB) pseudo-class selector

@Thihup
Copy link
Author

Thihup commented Oct 14, 2023

w3c/csswg-drafts#1110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants