将SVG元素放在img标记上

chi*_*ngo 3 javascript svg

如何将svg元素(rect,circle等)放在html上.这是我的编码.有谁可以帮忙.

<div id="myImgId" style="width: 200px; height: 200px; background:#000;" onmousedown="doSomething()" onmouseup="return false;">
<img src="Chrysanthemum.jpg" width="200" height="200" />
<svg id="svgOne" y="200" width="200" height="200"></svg>
</div> 
Run Code Online (Sandbox Code Playgroud)

san*_*hez 7

JSFIDDLE:http://jsfiddle.net/nsgch/

<div id="myImgId" style="width: 200px; height: 200px; background:#000;" onmousedown="doSomething()" onmouseup="return false;">
   <img src="Chrysanthemum.jpg" width="200" height="200" style="position:absolute;"/>

   <svg id="svgOne" y="200" width="200" height="200" style="position:absolute; left:90px; top:90px;">
      <path fill="#014da2" d="M16,1.466C7.973,1.466,1.466,7.973,1.466,16C1.466,24.027,7.973,30.534,16,30.534C24.027,30.534,30.534,24.027,30.534,15.999999999999998C30.534,7.973,24.027,1.466,16,1.466Z"></path>
   </svg>
</div> 
Run Code Online (Sandbox Code Playgroud)