SVG:svg要素
svg 要素は、新しい 座標系とビューポートを定義する コンテナである。
これは SVGドキュメントの最も外側の要素として使用されますが、SVG または HTML ドキュメントの中に SVGフラグメントを埋め込むためにも使用できる。
わからん.icon
x="top left corner when embedded (default 0)"
y="top left corner when embedded (default 0)"
width="the width of the svg fragment (default 100%)"
height="the height of the svg fragment (default 100%)"
viewBox="the points "seen" in this SVG drawing area.
4 values separated by white space or commas. (min x, min y, width, height)"
preserveAspectRatio="'none' or any of the 9 combinations of 'xVALYVAL' where VAL is 'min', 'mid' or 'max'. (default xMidYMid)"
zoomAndPan="'magnify' or 'disable'. Magnify option allows users to pan and zoom your file (default magnify)"
xml="outermost <svg> element needs to setup SVG and its namespace: xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve""
+ SVG:プレゼンテーション属性
All
svg - SVG: スケーラブルベクターグラフィック | MDN
<svg> - SVG: Scalable Vector Graphics | MDN
svg要素は個々に座標系とビューポート(表示領域)を持つ。
svg要素は空っぽの領域を確保するだけ。色も背景色もない。
code:svg
<svg>
...
</svg>
SVG:width属性
SVG:height属性
SVG:viewBox属性
SVG:座標系
SVG:ビューポート
SVG:コンテナ
https://svg-hosting.vercel.app/api/svg?url=https://scrapbox.io/api/code/suto3/SVG:svg要素/s.svg
svg要素は入れ子にできる。
code:s.svg
<svg
viewBox="0 0 300 100"
xmlns="http://www.w3.org/2000/svg"
stroke="red"
fill="pink">
<circle cx="50" cy="50" r="40" />
<circle cx="150" cy="50" r="4" />
<svg viewBox="0 0 10 10" x="200" width="100">
<circle cx="5" cy="5" r="4" fill="gold" />
</svg>
</svg>
SVG:g要素
svg要素.icon