--- title: points slug: Web/SVG/Attribute/points tags: - SVG - SVG属性 - 需要兼容性表 - 需要示例 translation_of: Web/SVG/Attribute/points --- <p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG属性参考主页</a></p> <p><code>points</code>属性定义了用来画一个{{ SVGElement("polyline") }}元素或画一个SVGElement("polygon") }}元素的点的数列。</p> <p>每个点用用户坐标系统中的一个X坐标和Y坐标定义。用逗号分开每个点的X和Y坐标标记是一个常用实践(但是并非必要),使用空间标注每个点。</p> <h2 id="用法">用法</h2> <table class="standard-table"> <tbody> <tr> <th scope="row">类别</th> <td>无</td> </tr> <tr> <th scope="row">值</th> <td><list-of-points></td> </tr> <tr> <th scope="row">可变性</th> <td>Yes</td> </tr> <tr> <th scope="row">规范文档</th> <td><a class="external" href="http://www.w3.org/TR/SVG/shapes.html#PolylineElementPointsAttribute">SVG 1.1 (2nd Edition): The polyline element</a><br> <a class="external" href="http://www.w3.org/TR/SVG/shapes.html#PolygonElementPointsAttribute">SVG 1.1 (2nd Edition): The polygon element</a></td> </tr> </tbody> </table> <h2 id="示例">示例</h2> <pre class="brush: xml"><svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <polygon points="100,10 250,150 200,110" style="fill:lime;stroke:purple;stroke-width:1" /> </svg> </pre> <h2 id="元素">元素</h2> <p>以下元素可以使用<code>points</code>属性:</p> <ul> <li>{{ SVGElement("polyline") }}</li> <li>{{ SVGElement("polygon") }}</li> </ul>