0006. 使用 polygon 绘制多边形
1. 💻 demos.1 - 使用 <polygon>
绘制多边形
xml
<svg style="margin: 3rem;" width="500px" height="500px" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
<!--
多边形与折线的绘制类似,不同在于终端节点和起始节点自动联通,完成闭合,并有默认颜色填充。
-->
<polygon
points="20 20, 90 90, 90 10, 20 90"
stroke="blue"
stroke-width="1"
opacity=".3"
/>
</svg>
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11