24 April 2023
Define some pages in separate elements, in this case, div tags. Suppose they have a class called "page". Add a unique id attribute to each "page" element. Add anchor tags that link to each id. Make sure that whichever element that contains the default or home page is the last in order of all "page" elements. Here, "page-1" is the default, and so it comes after "page-2" and "page-3".
Apply "display: none;" to all "page" elements first to hide all pages by default.
To display the first page by default, individually display "page-1" by selecting its id.
Use the ":target" pseudo class to display the a page element when its id is targeted.
Use the "~" to hide the first page when a different page id is targeted.
That is it. See the result. Get the source code for this example.