xml基于SVG绘制网页几何图形
原创
©著作权归作者所有:来自51CTO博客作者wx637f0ba1ddc42的原创作品,请联系作者获取转载授权,否则将追究法律责任
在一个Web页中,利用SVG绘制三个数学几何图形:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-flat-20030114.dtd">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<rect x="50" y="50" width="100" height="200" style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"/>
<ellipse cx="400" cy="150" rx="200" ry="80" style="fill:rgb(200,100,50);stroke:rgb(0,0,100);stroke-width:2"/>
<circle cx="300" cy="300" r="20" stroke="black" stroke-width="2" fill="red"/>
</svg>
绘制图形如下:
![xml基于SVG绘制网页几何图形_绘制图形](https://s2.51cto.com/images/blog/202211/24142818_637f0f027f91a11775.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=/resize,m_fixed,w_1184)