Multi-File HTML Editor
Build a multi-file HTML project in HCODX. Organize pages, CSS, JavaScript and images, check relative paths and export the complete folder structure.
Separate files when they have separate responsibilities
A multi-file project is easier to navigate only when its structure is predictable.
One large HTML file is convenient for a throwaway experiment. For a site with two pages, repeating the same style block in both files becomes error-prone. A shared stylesheet gives both pages the same visual rules and makes a design edit easier to review.
Keep page-specific text and semantic structure in each HTML document. Static HTML does not magically share a header component between files; if you duplicate that markup, you must update every copy or move to a templating/build system after export.
Pages
Give each document a clear filename and unique title and main heading.
Shared CSS
Place design tokens and reusable component rules in one stylesheet.
Assets
Use predictable filenames and verify image paths after moving files.
Read paths from the file that references them
Relative URLs are the most common source of a preview that looks right on one page and broken on another.
In index.html at the root, styles/site.css is a path down into the styles folder. In pages/about.html, that same stylesheet is one folder up, so the relative path is ../styles/site.css. The browser does not search the project tree for a matching filename.
Choose either clear relative paths or a deployment-aware root path. Before publishing, inspect every page—not only index.html—because a nested page may have a different path to the same asset.
<!-- index.html at the project root -->
<link rel="stylesheet" href="styles/site.css">
<script src="scripts/menu.js" defer></script>
<img src="images/logo.svg" alt="Site name">
<!-- pages/about.html, one folder deeper -->
<link rel="stylesheet" href="../styles/site.css">
<script src="../scripts/menu.js" defer></script>
<img src="../images/logo.svg" alt="Site name">Three asset paths that look similar but resolve differently
A link can be syntactically valid and still point to the wrong file after export or deployment.
Relative: styles/site.css
Resolved from the document that contains the link. From index.html at the root it reaches styles/site.css; from pages/about.html it would look for pages/styles/site.css instead.
Parent-relative: ../styles/site.css
Moves one directory up before following the rest of the path. This is the correct form for pages/about.html when styles/ is beside pages/.
Root-relative: /styles/site.css
Starts at the current web origin root. It can be convenient on a deployed root-domain site but may fail for file:// viewing or a site hosted below a subpath.
Absolute URL: https://example.com/site.css
Points to one specific origin. Use it deliberately for an external resource, knowing that availability, CORS policy and privacy may differ from a local asset.
Check the project as a set, not as a single preview
A ZIP is useful only if the linked pages and assets survive outside the editor.
Multi-file editing answers
Create a project with a real structure
Start with two pages and one shared stylesheet, then verify every relative path.
Instant HTML Runner & Viewer with Live Preview
Need to run a short HTML, CSS and JavaScript snippet? The HTML Runner Online has a focused editing surface with live output.
Open HTML Runner Online