js svg的事例

来源:互联网 发布:网络连接无法识别 编辑:程序博客网 时间:2024/04/29 08:20

svg.html:

<?xml version="1.0" ?>
<!DOCTYPE svg PLULIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2011/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%">
  <desc>
    an image of a square and a circle
  </desc>
  <defs>
    <rect id="rect1" width="200" height="200" fill="red" x="10" y="10" stroke="black" />
 <circle id="circle1" r="100" fill="white" stroke="black" cx="200" cy="200" />
  </defs>
  <g>
    <use xlink:href="#rect1" />
 <use xlink:href="#circle1" />
  </g>
</svg>

 

在浏览器查看的结果:

 

0 0