You built an HTML page in VS Code and it looks right on your screen. Now you want a friend, a client or a teacher to see it. The fastest way is to put the finished file online and send a link, because a link opens in any browser while a .html attachment often does not.
This guide shows why the usual "Live Server" button does not solve this, and three ways to share the page.
Why Live Server is not enough
Live Server is a popular VS Code extension. Its own page describes it as a local development server with live reload, and it lists connecting from a phone over your Wi-Fi as a feature. That is great while you are building.
But it is a development tool, not a publishing tool. The page lives on your computer. When you close VS Code or shut your laptop, the page is gone for everyone else. And a localhost link only means something on your own machine, so sending it to a client does nothing.
So the real question is: how do I put one finished file online for a short time, with as little setup as possible?
Before you share: make it one file
Most sharing tools take a single HTML file. If your page links to separate style.css, script.js or image files, those links break once the file leaves your folder.
Fix it in two minutes:
- Paste your CSS into a
<style>tag in the<head>. - Paste your JavaScript into a
<script>tag before</body>. - Use full
https://links for images that are already online, or embed small images as base64 data. - Open the file straight from your folder (double-click it) and check it still looks right.
If the page works when opened on its own, it will work as a link.
Option 1: Upload the file and get a link (fastest)
For a quick share, use a tool that turns a file into a link.
- Save the file in VS Code (Ctrl+S, or Cmd+S on Mac).
- Open DropMyPage and choose Upload file, then pick your
.htmlfile. You can also select all the code in VS Code, copy it, and use Paste HTML. - Tap Create link. You get a short link and a QR code.
- Send the link on WhatsApp, email or chat.
On the free plan you do not need an account, files can be up to 5 MB and the link works for 7 days. After that it expires. If you need the link to stay up, the paid plans keep it permanently.
Before sending, you can preview your code in the HTML viewer to catch mistakes.
Option 2: A static host for pages that should stay online
If it is a real website, or you want it online for months, use a static hosting service. GitHub Pages, Netlify and Cloudflare Pages are common choices. They are built for multi-file sites, so you do not need to merge your CSS and JavaScript. The trade-off is setup: an account, a repository or a deploy step, and sometimes a build setting. Check each service's own site for its current free limits.
Option 3: Send the file itself
You can attach the .html file to an email or a chat, but it often fails. Email services may block or strip HTML attachments, and on phones the file may open as plain text or not open at all. If the person is on a laptop and knows how to double-click a file, it can work. For everyone else, a link is safer. See How to open an HTML file on Android or iPhone for why phones struggle.
Which one should you pick?
| Situation | Best choice |
|---|---|
| Quick look at a finished page, one file | Upload and share a link |
| A site that should stay online for months | Static host |
| Sending to a tech-savvy person on a laptop | Attach the file |
| Sharing on WhatsApp | A link (how to send an HTML page on WhatsApp) |
Common problems
- Images are missing. They were separate files. Use full
https://links or embed them. - The styling is gone. The CSS was in a separate file. Move it into a
<style>tag. - The page works for you but not for them. You may be using a local path like
C:\Users\.... Replace it with an online link. - Scripts do not run. Check the browser console for errors on your own machine first.
FAQ
Can I share a localhost link from Live Server?
No. A localhost address only works on your own computer. Other people cannot open it, so you need to put the file online first.
Do I need to create an account?
Not for a quick free link on DropMyPage. A static host will ask you to sign up.
Is a shared link private?
A link works for anyone who has it, so do not share anything private. The Pro plan on DropMyPage lets you set a password on a page.
Can I update the page after sharing?
Replacing the page and keeping the same link is a Pro feature on DropMyPage. On the free plan, upload the new version and send the new link.