本文摘自PHP中文网,作者零下一度,侵删。
圆形 circle
1 2 3 4 5 6 7 8 9 | <svg width="200" height="200" >
<circle
cx="100"
cy="100"
r="80"
stroke="green"
stroke-width="4"
fill="none"/>
</svg>
|
矩形 rect
1 2 3 4 5 6 7 8 9 10 11 12 | <svg>
<rect
x="10"
y="10"
rx="5"
ry="5"
width="150"
height="100"
stroke="red"
fill="none">
</rect>
</svg>
|
椭圆 ellipse
1 2 3 4 5 6 7 8 9 10 | <svg>
<ellipse
cx="400"
cy="60"
rx="70"
ry="50"
stroke="red"
fill="none">
</ellipse>
</svg>
|
线 line
1 2 3 4 5 6 7 8 9 | <svg>
<line
x1="10"
y1="120"
x2="160"
y2="220"
stroke="red">
</line>
</svg>
|
折线 polyline
1 2 3 4 5 6 7 8 9 | <svg>
<line
x1="10"
y1="120"
x2="160"
y2="220"
stroke="red">
</line>
</svg>
|
多边形 polygon
1 2 3 4 5 6 7 8 9 10 11 | <svg>
<polygon
points="250 120
300 220
200 220"
stroke="red"
stroke-width="5"
fill="yellow"
transform="translate(150 0)">
</polygon>
</svg>
|
路径 path
可用于路径数据的命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | M = moveto
L = lineto
H = horizontal lineto
V = vertical lineto
C = curveto
S = smooth curveto
Q = quadratic Belzier curve
T = smooth quadratic Belzier curveto
A = elliptical Arc
Z = closepath
<svg>
<path
d="M250 150 L150 350 L350 350 Z" />
</svg>
|
以上就是SVG制作简单图形的实例介绍的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
微信小程序简单介绍
dw文本框制作步骤详解
canvas绘制各种基本图形
svg制作简单图形的实例介绍
用最简单的前端技术制作一个简洁的音乐播放器
滚动条的简单实现
制作动态视觉差背景(h5)的方法
在线演示一个全屏切换效果实例
移动端实现简单进度条
html怎样实现简单计算器
更多相关阅读请进入《图形》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » SVG制作简单图形的实例介绍