svg绘制的图形是矢量图形,放大依旧不会模糊,;
与css相似;
canvas绘制图形是通过控制dom。
<body>
<svg width="800" height="800">
<!-- 1. 绘制矩形 -->
<rect width='50' height='50' style="fill:red;" />
<!-- 2. 绘制线段 -->
<line x1="100" y1="100" x2="250" y2="75" style="stroke: blue;stroke-width:1;" />
<!-- 3. 绘制圆形 -->
<circle cx="200" cy="200" r="50" stroke="green" stroke-width=2 fill="red" />
</svg>
</body>