Forum How do I...?

Different footer on the last page

bjanis@docuprep.com
I'd like to flow three footers into the document. One for the first page, one for all subsequent pages but the last, and one for the last. The first two use cases are fairly easily done. I'm struggling with the last page. If I add a div or some other element with an id or class that selects the last page formatting it works, except that a page break gets added to the document with that div so I get an empty page with the correct footer. I want that footer applied to the last page of content.

<footer-page1>
<footer>
<footer-lastpage>
<content>


I know about using nth but that does not work in my use case. I don't know the number of pages. Any guidance would be appreciated.

Edited by bjanis@docuprep.com

howcome
Here's an example of how to change the heading on the last (or any) page:

https://css4.pub/2023/running-headers/#changing-header-on-last-page