
Anonymous A. answered 01/05/20
CSS Expert with 10+ years of experience
With CSS, you can't.
With JavaScript, possibbly.
But since this is a CSS question, the closest you can get to adding page numbers is by straight up adding them manually.
Do not add page numbers to your website
However, the concept of page numbers doesn't apply in the web. The reason is because websites' are not "linear", like a magazine. Any page of a website could be page 1, or last page.
Take for example the home page of a website. The basic concept is that the home page is the first page ALL users visit. Well, that's not necessarily the case. Users can very well get to a website via a link in a search result that it's not the home page. Then, after visiting that particular page they could possibly go to the home page. This means that in that particular scenario, the home page would've been page 2, and that initial page they first visited, would be page 1.
Then this whole thing changes for the next visitor, and so on.
This is why it is not recommended to add page numbers to a website.