aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/svg/attribute/points/index.html
blob: bf3a2b6579e460f9402a5ec6014284834b992d85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
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>&lt;list-of-points&gt;</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" title="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" title="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">&lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&gt;
  &lt;polygon points="100,10 250,150 200,110"
           style="fill:lime;stroke:purple;stroke-width:1" /&gt;
&lt;/svg&gt;
</pre>

<h2 id="元素">元素</h2>

<p>以下元素可以使用<code>points</code>属性:</p>

<ul>
 <li>{{ SVGElement("polyline") }}</li>
 <li>{{ SVGElement("polygon") }}</li>
</ul>