HTML Preview Missing Images or CSS? A Practical Fix Guide
10/9/2026 · 8 minute read · By Swelik
Understand why an HTML file works locally but loses pictures or styling when shared, and prepare a portable static preview that clients can actually review.
Your HTML file looks correct on your computer, but the shared preview has no pictures or styling. This usually means the page depends on files or services that did not travel with the HTML. A browser can only display resources it can actually reach; uploading one document does not automatically upload its neighboring folders.
This guide explains how to fix missing images and CSS in an HTML preview, prepare a portable design file and test it before sending a client link. The examples focus on static website mockups. A preview service is not a substitute for deploying an application with a backend, private API or interactive JavaScript requirements.
Understand what an HTML upload contains
An HTML document describes the page. It can include text, inline styles and references to images, fonts and stylesheets. A reference such as “images/hero.jpg” is a path to another resource. It is not the image itself. If you upload only “index.html,” that referenced image may still be sitting on your laptop.
The same issue applies to a stylesheet such as “styles.css.” Opening the page locally works because the browser can resolve the nearby file in your project folder. Once the HTML is served from another location, the relative path points somewhere else. The shared preview cannot read arbitrary files from your computer.
MDN explains how image sources can use relative or absolute URLs in its HTML images guide. For a single-file preview, the important practical question is whether each resource is embedded in the uploaded document or reachable through an appropriate public URL.
Start with the exact failure
If all styling is missing, check the stylesheet reference first. If the layout is styled but photographs are absent, inspect image sources and CSS background images. If the page looks almost correct except for typography, investigate the font source and fallback fonts. If only an interactive component is missing, the component may depend on JavaScript rather than static HTML and CSS.
This order saves time because it separates different problems. Re-uploading the same file repeatedly will not repair a relative image path. Compressing a PDF will not fix an HTML stylesheet. Changing the preview width will not make an authenticated asset URL public.
Keep one small example while diagnosing the issue. A heading, one stylesheet rule and one image are enough to test whether the basic resources survive the upload. Once those work, compare the full design and identify the additional dependency that changes the result.
Fix local image paths
A source such as “C:\\Users\\Designer\\Pictures\\hero.png” refers to a machine-specific file. A source beginning with “file://” has the same portability problem. Neither is a suitable reference for a client preview hosted on the web. Replace it with an embedded image or a public HTTPS asset URL that you have permission to use.
Relative paths can be appropriate when you deploy a complete website folder, but they require the corresponding files to be deployed at the expected locations. A single HTML upload should not be treated as a folder upload. Do not assume a sibling “assets” directory has been included unless the upload workflow explicitly supports that package.
For a portable single-file design, a base64 data image can keep a necessary asset inside the document. That increases the HTML size, so use it deliberately. For larger image collections, stable public HTTPS URLs may be more practical, provided the asset host permits the files to be displayed from another site.
Keep the CSS with the design
For a self-contained static mockup, placing the required CSS in a style element avoids dependence on a separate local stylesheet. Include the rules the exported markup actually uses, including responsive breakpoints, custom properties and typography settings. A page full of utility class names needs the corresponding generated CSS to look correct.
An external stylesheet can also work when it is available through a supported public HTTPS URL. Check that the URL returns CSS rather than a login page, redirect notice or HTML error document. A link that opens in your signed-in browser may still fail for a client who has no access to the same account.
CSS background-image paths require special attention. Relative URLs inside an external stylesheet resolve relative to that stylesheet's location, not necessarily the HTML document. MDN documents this behavior in the CSS URL reference. Moving CSS inline can therefore change where its relative asset references point.
Check third-party pictures and fonts
A third-party image link is not guaranteed to remain available indefinitely. The owner can remove the file, change its address, require authentication or restrict embedding. Temporary signed links may expire after you send the preview. If the image is essential to the design review, use an asset location with an appropriate lifetime or embed an authorized copy.
Avoid using a page URL where an image URL is required. A photo-sharing page may display an image in your browser, but its address often returns an HTML page rather than image bytes. Test the resource itself and make sure you are allowed to reuse or embed it. A working technical URL does not establish usage rights.
Fonts have their own loading rules. A fallback font can change line wrapping and section heights even when the rest of the page loads. Include a sensible fallback stack and inspect the design after the intended font has loaded. If an external font fails, the preview should remain readable rather than depending on invisible text.
Distinguish static styling from script-dependent behavior
Some exports contain HTML class names but rely on a script to generate styles at runtime. Others use JavaScript to insert the page content, load images or initialize a component. A secure static preview may intentionally block those scripts. In that situation, preserving the script text is not the same as supporting the application.
Prefer an export that includes the actual HTML content and the compiled CSS needed to display it. Swelik supports static HTML and CSS previews in an isolated frame; it does not promise unrestricted execution of arbitrary uploaded JavaScript. Third-party display assets and application code are different categories of dependency.
If the review depends on a working menu, checkout, map integration or authenticated API, use an appropriate application deployment or prototyping tool. A static preview is useful for reviewing appearance, layout and content. Be clear with the client about which interactions are illustrative and which are expected to function.
Prepare a portable HTML preview
First, identify every external dependency in the design: stylesheets, image sources, background images and fonts. Remove references to local disk paths. Replace essential local dependencies with inline content or supported public HTTPS resources. Keep any secrets, tokens and private API configuration out of the document.
Next, open the prepared file outside your normal working folder or inspect it in a clean test environment. This helps reveal accidental reliance on files that happen to exist next to the original. Check the header, hero image, lower sections and footer. Missing assets are not always obvious in the first screenful.
Then upload the file to Swelik and open the public preview link. Compare it with the intended design. Test the available viewport sizes, especially a narrow mobile width. If the CSS has responsive breakpoints, the layout can adapt; a fixed-width design will not automatically become responsive just because it is inside a preview frame.
Finally, save the management link privately and send only the public URL to the client. If you fix the HTML later, replace the mockup through the existing project so the review URL stays consistent. Tell the client which assets or sections were corrected instead of asking them to guess what changed.
A quick troubleshooting checklist
No images: Check for local or relative paths, expired URLs, authentication requirements and incorrect resource addresses. Confirm that the image host permits the intended use.
No CSS: Check whether the stylesheet was included, whether its URL is reachable and whether the document depends on runtime code to generate styles. Verify that class names and exported rules match.
Wrong fonts: Check the font URL, cross-origin restrictions and fallback stack. Inspect line wrapping after the page finishes loading, because typography can change the full page height.
Desktop works, mobile does not: Check fixed widths, overflow and media queries. Compare the responsive design itself with the preview frame. A viewport control changes the available width; it cannot supply missing responsive CSS.
A component is absent: Check whether JavaScript creates it. For static review, export its visible state as HTML and CSS or use an image/PDF mockup instead. Do not put credentials into the file to make a private service accessible.
Frequently asked questions
Can I upload only an HTML file and keep all nearby assets?
Only if those assets are embedded or accessible through supported URLs. Nearby files on your computer are separate resources. A single-file upload does not automatically include an entire project folder.
Should I embed every image as base64?
Not necessarily. Embedding improves portability but can make the document much larger. Use it for a manageable set of essential images, and consider stable HTTPS assets where appropriate. Inspect both the visual result and loading time before sharing.
Does a PDF avoid these problems?
A PDF export usually packages the page's visual content into the document, which can simplify static review. It does not preserve HTML responsiveness or application behavior. Choose the format based on the review task, using the website mockup format guide when comparing options.
What is the best final test?
Open the public preview as a recipient on desktop and mobile, scroll the entire page and check the resources that matter most. A preview is ready when the client can see the intended design without depending on your laptop, local folders or private account session.
Put this into practice with Swelik’s mockup sharing and review tools.