javascript绘制两个svg
时间: 2023-06-28 20:07:15 浏览: 126
要绘制两个 SVG,可以使用以下代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>绘制两个 SVG</title>
</head>
<body>
<svg width="100" height="100">
<rect x="10" y="10" width="80" height="80" fill="red"/>
</svg>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" fill="blue"/>
</svg>
</body>
</html>
```
在这个例子中,我们创建了两个 SVG 元素,每个 SVG 元素都有一个不同的形状。第一个 SVG 元素包含一个红色的矩形,而第二个 SVG 元素包含一个蓝色的圆形。
注意,每个 SVG 元素都有自己的宽度和高度,可以根据需要进行调整。此外,每个 SVG 元素内部的形状也可以根据需要进行更改。
阅读全文
相关推荐















