<g>
<g> SVG 元素是一個容器,用於組合其他 SVG 元素。
應用於 <g> 元素的變換將應用於其子元素,並且其屬性將被其子元素繼承。它還可以將多個元素組合起來,以便稍後使用 <use> 元素進行引用。
使用語境
屬性
此元素僅包含全域性屬性。
DOM 介面
此元素實現了 SVGGElement 介面。
示例
html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<!-- Using g to inherit presentation attributes -->
<g fill="white" stroke="green" stroke-width="5">
<circle cx="40" cy="40" r="25" />
<circle cx="60" cy="60" r="25" />
</g>
</svg>
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # GElement |
瀏覽器相容性
載入中…