SVG:foreignObject要素
<foreignObject> - SVG: Scalable Vector Graphics | MDN
<foreignObject> - SVG: Scalable Vector Graphics | MDN
inline で HTML を埋め込める
https://svg-hosting.vercel.app/api/svg?url=https://scrapbox.io/api/code/suto3/SVG:foreignObject要素/fo.svg
code:fo.svg
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<style>
div {
color: white;
font: 18px serif;
height: 100%;
overflow: auto;
}
</style>
<polygon points="5,5 195,10 185,185 10,195" />
<!-- Common use case: embed HTML text into SVG -->
<foreignObject x="20" y="20" width="160" height="160">
<!--
In the context of SVG embedded in an HTML document, the XHTML
namespace could be omitted, but it is mandatory in the
context of an SVG document
-->
<div xmlns="http://www.w3.org/1999/xhtml">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis mollis
mi ut ultricies. Nullam magna ipsum, porta vel dui convallis, rutrum
imperdiet eros. Aliquam erat volutpat.
</div>
</foreignObject>
</svg>
SVG:object
SVG:グラフィックコンテンツ
SVG要素.icon