-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
SVG Shapes
- 矩形 (ect)
- 圆形 (circle)
- 椭圆 (ellipse)
- 线 (line)
- 折线 (polyline)
- 多边形 (polygon)
- 路径 (path)
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect width="300" height="100"
style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"/>
</svg>rect 元素的 width 和 height 属性可定义矩形的高度和宽度
- style 属性用来定义 CSS 属性
- CSS 的 fill 属性定义矩形的填充颜色(rgb 值、颜色名或者十六进制值)
- CSS 的 stroke-width 属性定义矩形边框的宽度
- CSS 的 stroke 属性定义矩形边框的颜色
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="50" y="20" width="150" height="150"
style="fill:blue;stroke:pink;stroke-width:5;fill-opacity:0.1;"
stroke-opacity:0.9"/>
</svg>svg透明度
- CSS opacity 属性用于定义了元素的透明值 (范围: 0 到 1)。
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="50" y="20" width="150" height="150"
style="fill:blue;stroke:pink;stroke-width:5;opacity:0.5"/>
</svg>rx 和 ry 属性可使矩形产生圆角
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<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>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels