Skip to content
Websites & files

HTML works on your computer but breaks online: 10 fixes

Missing styles, broken images, a blank page, scripts that silently stop. Almost every case comes down to one of ten differences between opening a file locally and serving it from the web.

10 min readUpdated October 2026By the HTMLtoLink team
Short answer

When HTML works locally but not online, a file reference is almost always wrong for the web: a path to your own disk, a backslash, different upper/lower case, a file you did not upload, or an http:// resource blocked on an HTTPS page. Open the browser console (F12 → Console and Network) to see the exact failing URL, then fix the path or upload the missing file.

First, find the actual error

Open the published page, press F12 (or Cmd+Option+I on Mac) and look at two tabs:

  • Console — JavaScript errors and blocked requests, in red.
  • Network — reload the page; any file with status 404 is a path problem.

Then match what you see to the list below.

1. Paths that point at your computer

src="C:\Users\sam\Desktop\site\logo.png" or file:///Users/sam/… only exists on your machine. Use a path relative to the HTML file: src="logo.png" or src="images/logo.png".

2. Backslashes

images\logo.png works on Windows and fails on web servers. Always use forward slashes in HTML and CSS.

3. Upper and lower case

Logo.PNG and logo.png are the same file on Windows and macOS but different on Linux servers, which most hosts run. HTMLtoLink matches case-insensitively as a safety net; other hosts return 404. Stick to lowercase file names.

4. Files you did not upload

Uploading only index.html leaves style.css, script.js and images/ behind. Upload the whole folder or a ZIP, or make the page a single file.

5. The CSS file is relative to the wrong place

Paths inside a CSS file are relative to the CSS file, not the page. If css/style.css uses url(images/bg.jpg), the browser looks in css/images/. Write url(../images/bg.jpg).

6. Mixed content (http on https)

Every HTMLtoLink page is HTTPS. Browsers block scripts, stylesheets and iframes loaded over plain http:// on such a page. Change the URL to https://; nearly every CDN supports it.

7. JavaScript runs before the HTML exists

A script in <head> that calls document.getElementById('app') gets null, because the body has not been parsed yet. Move the script to the end of <body> or add defer.

8. Modules, imports and React without a build

import statements need <script type="module"> and full or relative URLs with extensions (./app.js, not app). JSX and bare imports like import React from 'react' need a build step — upload the built dist/ folder instead of the source.

9. API calls blocked by CORS or missing keys

A page that fetched data fine from your local dev server may be blocked online if the API does not allow requests from other origins (CORS). And an API that needs a secret key cannot safely be called from public HTML at all. Use APIs designed for browsers, or put a small backend in between.

10. You are seeing an old version

After updating, your browser or a CDN may serve a cached copy for a short time. Hard-reload with Ctrl+Shift+R (Cmd+Shift+R). On HTMLtoLink an update reaches every visitor within about a minute.

Prevent it next time

ZIP Site Checker
Open a ZIP or folder and find missing files, wrong case and bad paths
Open the free tool

Before uploading a folder, the ZIP site checker verifies every reference against the real files; for a single document, use the HTML checker.

Questions people ask

Why are my images not showing after upload?

The image path does not match the uploaded file: a local disk path, different case, a backslash, or the image was not included. Check the Network tab for the 404 URL.

Why is my page blank online?

Usually a JavaScript error stops the page from rendering. The Console shows the error and line number; a truncated AI-generated file is a common cause.

Why does my CSS not load?

The <link> href does not point at the uploaded CSS file, or it uses http:// on an https page. Make it a relative path like css/style.css.

Read next

Your HTML deserves a real link

Paste code, drop a file, a ZIP or a whole folder — get a live URL with your own address, an optional password and a QR code. Free to start with Google sign-in; paid plans keep links online for good.

Turn HTML into a link