<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 |
浏览器兼容性
加载中…