HTML, CSS, and JavaScript

Why does my HTML file lose CSS and JavaScript on iPad?

An HTML file loses CSS and JavaScript on iPad when its linked files are left behind or it's only previewed. Here's why it happens and how to fix it.

Short answer

An HTML file usually loses its CSS and JavaScript on iPad for one of two reasons: it was opened in a lightweight preview that doesn't run scripts, or only the .html file was copied without the stylesheets, scripts and images it links to. Open the file in a WebKit-based viewer, and if it's a multi-file page, open a ZIP of the whole folder.

Reason one: you're seeing a preview, not a page

Tapping an HTML file in the iPad Files app opens Quick Look. It's designed to show a document quickly, and in many cases it doesn't run JavaScript or load linked files from neighboring folders.

So even a perfectly built page can look broken there: buttons are inert, menus never open, and the layout falls back to plain stacked text. More on that in why HTML doesn't render correctly in Files.

Reason two: the page's other files didn't come along

Most real pages aren't a single file. The HTML points to other files using paths, for example:

  • css/style.css for layout and colors
  • js/app.js for interactivity
  • images/logo.png and fonts/brand.woff2 for visuals and type

If you AirDrop or email just index.html, those paths point to nothing. The browser engine looks for css/style.css next to the file, finds no such folder, and silently skips it. The page loads, but naked.

This is the most common cause when a page looked fine on a computer and breaks on iPad.

A quick test to tell the two apart

Before changing anything, find out which problem you have. It takes a minute.

  • Look inside the HTML: if you see link tags pointing to .css files or script tags with a src pointing to .js files, the page depends on separate files.
  • If everything sits inside style and script tags in the same file, it's self-contained, and the issue is almost certainly the preview.
  • Check how the file arrived: a lone index.html in an email or chat means its folder stayed behind.
  • Open the file in a WebKit-based viewer. If the layout appears but images are missing, it's a path problem; if nothing changes, assets are missing entirely.

The fix: open the whole project as a ZIP

The reliable fix is to keep the folder together. HTML Keep unpacks a ZIP into its own project folder, so every relative path keeps working.

  1. Compress the folder that contains the HTML and its assets. On a Mac, right-click the folder and choose Compress. On iPad, long-press the folder in Files and tap Compress.
  2. Move the ZIP to your iPad by AirDrop, Files, iCloud Drive, email or a chat app.
  3. Tap Share on the ZIP and choose HTML Keep, or drag it from Files onto the app's home screen in Split View.
  4. The app opens the default entry page. If the ZIP contains several pages, switch between them from the viewer's page list.
  5. Check that styles, scripts, images, fonts, audio and video now load.

For more on multi-file projects, see opening a ZIP web project on iPad. The app is available from the download page.

Still missing something? Check these

  • Absolute paths: /css/style.css starts at a server root that doesn't exist locally. Change it to css/style.css.
  • Computer-specific paths: C:\Users\... or file:///Users/... only exist on the original machine.
  • Case mismatch: Logo.PNG and logo.png are different names to many systems. Match the spelling exactly.
  • Files outside the folder: a link like ../shared/theme.css reaches above the zipped folder. Zip the parent folder instead.
  • CDN resources: libraries or web fonts loaded from the internet need a connection.
  • Server features: PHP, a Node backend or an API on your own server won't run on the iPad.

Who runs into this most

Students sharing coursework, designers sending a prototype, and anyone exporting a page from a site builder or an AI tool tend to hit this. The page is fine; it just needs to travel as a bundle.

Once a project opens correctly in HTML Keep, it stays in your library with its files intact, so you won't need to repeat the fix next time.

Frequently asked questions

Can I fix the paths inside HTML Keep?

No, it doesn't edit source code. Correct the paths in an editor, zip the folder again, and re-import it to update the project.

Do I need to zip a page that is a single file?

No. If all the CSS and JavaScript are inside the HTML file, opening the .html directly works.

Why does it work on my computer but not on iPad?

On the computer the browser can reach the neighboring folders. On iPad, a shared single file arrives without them.

Does the same fix apply on iPhone?

Yes. Zipping the folder and opening the ZIP in HTML Keep works the same way on iPhone.

Android updates

Leave your email and we will notify you when Android testing or Google Play access opens.

We will only use this email for Android availability updates. Privacy