How to add a non-svg (html) element inside svg.
Last active
September 8, 2017 12:52
HTML element inside a SVG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML inside SVG</title> | |
<style type="text/css"></style></head> | |
<body> | |
<div>I'm a div inside the HTML</div> | |
<svg width="500" height="300" style="border:1px red solid"> | |
<foreignobject class="node" x="46" y="22" width="100" height="100"> | |
<div style="border:1px green solid">I'm a div inside a SVG.</div> | |
</foreignobject> | |
</svg> | |
<div>Interesting! But you a Foreign Object.</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great demo! There's a typo, though:
Looks like you accidentally the verb :)