Skip to content

Instantly share code, notes, and snippets.

@tarwin
Created March 21, 2021 03:17
Show Gist options
  • Save tarwin/18166fe35e37c962c0294d543eea7726 to your computer and use it in GitHub Desktop.
Save tarwin/18166fe35e37c962c0294d543eea7726 to your computer and use it in GitHub Desktop.
SVG: Embedding HTML (and an IFrame)
Display the source blob
Display the rendered blob
Raw
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
viewBox="0 0 400 400"
style="background-color: #000;"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<foreignObject
x="0"
y="0"
width="400"
height="400"
>
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 100%; height: 100%;">
<iframe width="100%" height="100%" src="https://dazzling-mirzakhani-0f3cde.netlify.app/" style="border: none;" />
</div>
</foreignObject>
</g>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment