polygon
<polygon>
该<polygon>元素定义了由一组连接的直线段组成的闭合形状。最后一点连接到第一点。对于开放形状,请参阅<polyline>元素。
用法
类别 | 基本元素, 图形元素, 形状元素 |
---|
允许的内容物 | 任意数量、任意排序的下列元素: 动画元素,描述性元素 |
属性
全局属性
专有属性
DOM 接口
该元素实现了SVGPolygonElement
接口。
示例
SVG
<svg width="120" height="120" viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<polygon points="60,20 100,40 100,80 60,100 20,80 20,40"/>
</svg>
结果
规范
Specification | Status | Comment |
---|
Scalable Vector Graphics (SVG) 2The definition of '<polygon>' in that specification. | Candidate Recommendation | No change |
Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<polygon>' in that specification. | Recommendation | Initial definition |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | IE | Opera | Safari |
---|
Basic support | 1.0 | (Yes) | 1.5 (1.8) | 9.0 | 8.0 | 3.0.4 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|
Basic support | 3.0 | (Yes) | 1.0 (1.8) | No support | (Yes) | 3.0.4 |