HTML inside SVG
✓ Published0🌍 Public
JJverma
Last edited Jan 22, 2016
Created on Jan 22, 2016
This example demonstrates how to embed standard HTML elements inside an SVG canvas using the `foreignObject` API. A red-bordered SVG contains a green-bordered `div` positioned at specified x and y coordinates, while separate HTML `div` elements appear above and below the SVG. The page loads as a standalone `index.html` file with no external libraries, relying purely on native SVG and HTML markup to show that foreign objects can mix rendering contexts within a single graphic.
AI-generated descriptionHTML inside a SVG using foreignObject.
How to add a non-svg (html) element inside svg.