-2

Im trying to insert a image link in svg position with text

this is my code

<svg width="100" height="100">
 <circle cx="20" cy="20" r="20" fill="green" />
       <circle cx="70" cy="70" r="20" fill="purple" />
  <text x="20" y="20" font-family="sans-serif" font-size="20px"     
  fill="red">Hello!</text>
<image      xlink:href="https://s-media-cache-ak0.pinimg.com/736x/76/47/9d/76479dd91dc55c2768ddccfc30a4fbf5--pikachu-halloween-costume-diy-halloween-costumes.jpg"        />
   </svg>

How I could do this

Please help me

alberto2
  • 3
  • 3

1 Answers1

0

Images (<image>) in SVG need to have a width and height specified. If you don't give a width and height, they default to 0, meaning the image won't be visible.

<svg width="100" height="100">
 <circle cx="20" cy="20" r="20" fill="green" />
       <circle cx="70" cy="70" r="20" fill="purple" />
  <text x="20" y="20" font-family="sans-serif" font-size="20px"     
  fill="red">Hello!</text>
  <image xlink:href="https://s-media-cache-ak0.pinimg.com/736x/76/47/9d/76479dd91dc55c2768ddccfc30a4fbf5--pikachu-halloween-costume-diy-halloween-costumes.jpg"
         x="10" y="50" width="37" height="37"/>
</svg>
Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181