SVG初识【一】

矩形

<svg width="400" height="110">
 
<rect width="300" height="100"
style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
</svg>

在这里插入图片描述

<svg width="400" height="180">
<rect x="50" y="20" rx="20" ry="20" width="150"
height="150"
  style="fill:red;stroke:black;stroke-width:5;opacity:0.5" />
</svg>
svgsvg标签
widthsvg宽度
heightsvg高度
rectrect标签
widthrect宽度
heightrect高度
style基本属性
fill填充颜色fill:rgb(0,0,255)
stroke-width边缘宽度stroke-width:3
stroke边框颜色stroke:rgb(0,0,0)
rx,ry圆角效果

圆形

<svg height="100" width="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>

在这里插入图片描述

circle圆形
cx左边距
cy上边距
r:rx ry 的缩写圆只有r 图形的宽高曲率
stroke边框颜色black
stroke-width边框宽度
fill内填充颜色red

椭圆

<ellipse cx="200" cy="80" rx="100" ry="50" style="fill:yellow;stroke:purple;stroke-width:2" />

cx左边距
cy右边距
rx主轴长度
ry侧轴长度

直线

<line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" />
line类型
x1,y1起始坐标
x2,y2结束坐标
style填充颜色和宽度

折线

<polyline points="50 100,150 100,
150 80,200 150,
150 220,150 200,
50 200,50 100"
 style="fill:none;stroke:black;stroke-width:3" />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值