polyline
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
* Some parts of this feature may have varying levels of support.
polyline元素是 SVG 的一个基本形状,用来创建一系列直线连接多个点。典型的一个polyline是用来创建一个开放的形状,最后一点不与第一点相连。欲了解闭合形状,请看<polygon> 元素。
使用上下文
示例
html
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- 具有默认填充的折线示例 --> <polyline points="0,100 50,25 50,75 100,0" /> <!-- 具有描边但无填充的相同的多段线形状示例 --> <polyline points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> 属性
>全局属性
专有属性
DOM 接口
该元素实现了 SVGPolylineElement 接口。