- Why doesn't my CSS file or image show up in the preview?
- Because the preview can only see the code you pasted, not the folder it came from. A line like <link href="style.css"> or <img src="images/logo.png"> points to a file next to your HTML on your computer, and that file never came along. Relative paths resolve against this website instead, where those files don't exist. Two fixes: paste the stylesheet inside a <style> tag in the head, or change the path to a full address that starts with https://. Small images can also go inline as data: URIs.
- Is it safe to paste HTML that has JavaScript in it?
- Safer than opening it on most viewer sites. The preview runs in a sandboxed frame with its own opaque origin, which means a script inside it can't read this page, its cookies, or its storage, and can't send the tab somewhere else. That's why try{parent.document.title='x'} fails inside the preview. The sandbox doesn't make hostile code harmless, though: a script can still show pop-ups, and it can still load things from other servers. Don't paste code you'd never run on your own machine.
- Does my HTML get uploaded anywhere?
- No. The code goes from the text box straight into a frame in the same tab, and opening a file reads it on your device. Nothing is sent to our servers or saved. One thing to know: if your HTML references outside resources, like web fonts, a CDN script, or a tracking pixel in an email template, your browser fetches those from their own servers when the preview renders, exactly as it would if you opened the file locally.
- Why does my script throw an error about localStorage or cookies?
- Because of the sandbox. A page with an opaque origin has no storage of its own, so reading localStorage, sessionStorage, IndexedDB, or document.cookie throws a SecurityError instead of returning data. This is the same wall that keeps pasted code away from this site. If your page depends on storage, preview the layout here, then test the storage logic by opening the file from a local server such as npx serve or python -m http.server.
- Can I use this to check an HTML email before sending it?
- For a first look, yes. Paste the template, check it at Mobile width, and catch broken tables, missing images, and wrapping headlines. What you see is how a modern browser draws it, which is close to Apple Mail and most webmail. It isn't how every inbox draws it. Outlook for Windows desktop has long used Microsoft Word's layout engine, which ignores a lot of CSS, and Gmail rewrites some styles. Send yourself a test before a big send.
- What do the Tablet and Mobile widths actually change?
- They set the preview frame to 768 or 375 CSS pixels wide, the common breakpoint for tablets in portrait and the width of many phones. Inside the frame, the viewport really is that wide, so @media (max-width: 600px) rules switch on and percentage widths shrink. It isn't a full device emulator: the user agent stays your desktop browser's, there are no touch events, and the device pixel ratio doesn't change. When the frame is wider than your screen, it scrolls sideways inside its box.
- Why did live update turn itself off?
- Your HTML went over 1 MB. Every redraw rebuilds the whole page, and at that size doing it after each pause in typing makes the tab stutter. The preview waits for you instead: edit as much as you like, then press Run. You can switch Live update back on if you want. Pasted code and files can go up to 5 MB; past that, paste the part you're working on.
- My page froze the preview. How do I get it back?
- Something in the page is probably stuck in a loop, like while(true){} or a timer that keeps adding elements. Press Clear to drop the page. If the tab is too busy to respond, reload it, which stops every script on the page. Fix the loop before pasting it again. Browsers may run a sandboxed frame on the same thread as this page, so a runaway script can slow both.
- Can I open an .html file on my phone?
- Yes. Tap Open file and pick the file from your Files app, Google Drive, or downloads. .html, .htm, and .txt files up to 5 MB work, and the file is read on your phone, not uploaded. This is handy when someone emails you an .html attachment and your phone offers to show it as plain code. The preview drops below the code on small screens, so scroll down to see the page.