<svg xmlns="http://www.w3.org/2000/svg"
width="200px" height="200px" viewBox="0 0 200 200">
<!--画笔颜色-->
<line x1="10" y1="10" x2="50" y2="10" style="stroke: red;stroke-width: 5;"/>
<line x1="10" y1="20" x2="50" y2="20" style="stroke: #9f9;stroke-width: 5;"/>
<line x1="10" y1="30" x2="50" y2="30" style="stroke: #9999ff;stroke-width: 5;"/>
<line x1="10" y1="40" x2="50" y2="40" style="stroke: rgb(255,128,65);stroke-width: 5;"/>
<line x1="10" y1="50" x2="50" y2="50" style="stroke: rgb(60%,20%,60%);stroke-width: 5;"/>
<!--画笔透明度-->
<line x1="10" y1="60" x2="50" y2="60" style="stroke: red;stroke-width: 5;stroke-opacity:0.2"/>
<line x1="10" y1="70" x2="50" y2="70" style="stroke: red;stroke-width: 5;stroke-opacity:0.4"/>
<line x1="10" y1="80" x2="50" y2="80" style="stroke: red;stroke-width: 5;stroke-opacity:0.6"/>
<line x1="10" y1="90" x2="50" y2="90" style="stroke: red;stroke-width: 5;stroke-opacity:0.8"/>
<line x1="10" y1="100" x2="50" y2="100" style="stroke: red;stroke-width: 5;stroke-opacity:1"/>
<!--画笔点线或虚线-->
<!--9个像素的实线,5个像素的空隙-->
<line x1="10" y1="110" x2="100" y2="110" style="stroke-dasharray:9,5;stroke:black;stroke-width:2" />
<!--5个像素的实线,3个像素的空隙,9个像素的实线,2个像素的空隙-->
<line x1="10" y1="120" x2="100" y2="120" style="stroke-dasharray:5,3,9,2;stroke:black;stroke-width:2" />
<!--复制奇数个数,这等价于:9个像素的实线,3个像素的空隙,5个像素的实线,9个像素的空隙,3个像素的实线,5个像素的空隙-->
<line x1="10" y1="130" x2="100" y2="130" style="stroke-dasharray:9,3,5;stroke:black;stroke-width:2" />
</svg>
标签:SVG,线段,绘制 来源: https://www.cnblogs.com/xl4ng/p/15858911.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。