Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A simple no-JS single-file HTML template using :target and anchors to create multi-page sites.
John Doe is a minimal, single-file HTML template that builds a multi-page website with no JavaScript by using anchor fragments and the CSS :target selector to toggle visible sections.
John Doe is a static-site template distributed as a single HTML file; its demo runs on Neocities. The template takes a set of HTML sections, each with a unique id, and turns them into switchable "pages" controlled purely through URL fragments such as #about or #contact. No server processing, JavaScript, or build tools are involved: a plain text editor and a browser are enough to make and preview a site. The source repository carries 522 stars, and its declared topics are html, no-js, oldschool, and static-site.
.html file, so it can be copied, emailed, or uploaded to any static host without extra assets or configuration.#anchor suffix, and the :target CSS pseudo-class displays the matching <section> while hiding the rest, giving the feel of separate pages without reloads.<section> with a unique id into the file and add an <a href="#id"> link in the nav.:target selector works and can edit or extend the template while seeing immediate results in a browser.<section> with a unique id (for example, id="contact").<a href="#contact"> link inside the navigation.:target CSS rule makes that section visible.No. All page switching is handled by the CSS :target selector and standard anchor links, so the template runs without a single script tag.
Add a new <section> with a unique id attribute anywhere in the HTML, then add an <a href="#that-id"> link in the <nav>. The CSS automatically shows that section when the link is clicked.
It is a one-page template that simulates separate pages: every section lives in the same HTML file, and the URL fragment (the part after the #) changes to reflect the current section.
Any static host will work, including Neocities (where the demo lives), GitHub Pages, Netlify Drop, or even a local file opened directly in a browser.