|
|
|
|
|
by sltkr
626 days ago
|
|
A very simple alternative is to type "data:text/html," in the URL bar, and then just paste your HTML content after it, generating a URL that looks like this: data:text/html,<!DOCTYPE html><html><body>Hello, world!</body></html>
Most browsers don't preserve newlines when pasting (Chrome replaces them with spaces, Firefox seems to remove them) so this occasionally breaks stuff that depends on exact whitespace formatting (like <pre>-blocks or Javascript code without semicolons), but 99% of the time it works just fine.Rendering SVG can be done exactly the same way, using "data:image/svg+xml," as the prefix. For example: data:image/svg+xml,<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg"> <circle r="45" cx="50" cy="50" fill="red" /> </svg>
|
|