This is nowadays possible using [CSS Generated Content for Paged Media Module](https://www.w3.org/TR/css-gcpm-3/#introduction) using [running elements](https://www.w3.org/TR/css-gcpm-3/#running-elements).
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
@page {
@bottom-center {
content: element(footer);
}
}
.last-page-footer {
position: running(footer);
}
<!-- language: lang-html -->
<p>I'm the content. Extend me until I fit on several pages.</p>
<div class="last-page-footer">
I'm the footer
</div>
<!-- end snippet -->
As of 2024, these attributes are no properly supported by browsers. Until they are supported, you can use [Paged.js](https://pagedjs.org/) as a polyfill:
> Paged.js is a polyfill for some CSS properties made to print HTML from the browser.
> The W3C CSS modules that Paged.js aims to implement are the following:
> - [CSS Paged Media Module Level 3](https://www.w3.org/TR/css3-page/)
> - [CSS Generated Content for Paged Media Module](https://www.w3.org/TR/css-gcpm-3/)
> - [CSS Fragmentation Module Level 3](https://www.w3.org/TR/css-break-3/)
To use Paged.js as a polyfill, copy the line below to the `head` of your document.
```html
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
```
This is nowadays possible using [CSS Generated Content for Paged Media Module](https://www.w3.org/TR/css-gcpm-3/#introduction) using [running elements](https://www.w3.org/TR/css-gcpm-3/#running-elements).
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
@page {
@bottom-center {
content: element(footer);
}
}
.last-page-footer {
position: running(footer);
}
<!-- language: lang-html -->
<p>I'm the content. Extend me until I fit on several pages.</p>
<div class="last-page-footer">
I'm the footer
</div>
<!-- end snippet -->
As of 2024, these attributes are no properly supported by browsers. Until they are supported, you can use [Paged.js](https://pagedjs.org/) as a polyfill:
> Paged.js is a polyfill for some CSS properties made to print HTML from the browser.
> The W3C CSS modules that Paged.js aims to implement are the following:
> - [CSS Paged Media Module Level 3](https://www.w3.org/TR/css3-page/)
> - [CSS Generated Content for Paged Media Module](https://www.w3.org/TR/css-gcpm-3/)
> - [CSS Fragmentation Module Level 3](https://www.w3.org/TR/css-break-3/)
To use Paged.js as a polyfill, copy the line below to the `head` of your document.
```html
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
```