绘制直线:
x1/y1:设置起点
x2/y2:设置终点
<line x1="100" y1="100" x2="300" y2="100" stroke="#000"></line>
绘制折线:
points:设置所有的点,两两一对
<polyline points="100 100 300 100 300 300" stroke="#000" fill="none"></polyline>
绘制多边形:
polygon和polyline差不多,只不过会自动关闭路径
<polygon points="100 100 300 100 300 300" stroke="#000" fill="none"></polygon>
svg常用属性:
fill:修改填充颜色
fill-opacity:0~1 设置填充颜色的透明度
stroke:修改描边颜色
stroke-width:修改描边宽度
stroke-opacity:0~1设置描边透明度
stroke-linecap:butt/square/round 设置线段两端帽子
stroke-dasharray:设置虚线
stroke-daoshffset:设置虚线偏移位
stroke-linejoin:miter/bevel/round 设置折线转角样式
注意点: 在SVG中这些所有的常用属性都是可以直接在CSS中使用的