4

Inside a html page, I have this simple .svg code:

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 841.9 1190.6" xml:space="preserve">
<rect id="image-test" x="0" y="0" width="250" height="250" fill="none">
    <image width="250px" height="250px" href="https://pbs.twimg.com/profile_images/1450222519/logosf_positif_03_icon.png" />
</rect></svg>

Even if I use xlink:href for the <image /> node, the image is still not displayed. The url to image is valid and the image exists: https://pbs.twimg.com/profile_images/1450222519/logosf_positif_03_icon.png. But the image seems to be displayed outside the <rect /> node, inside the root <svg />. What is wrong with my code?

Gligor Florin
  • 380
  • 1
  • 2
  • 12
  • What's wrong is you've put an image inside a rect element. What do you actually want to accomplish? – Robert Longson Jan 05 '17 at 14:05
  • First of all, I want to place an image inside a svg structure (yes, I`m new to svg). But I need a rectangle to act as a wrapper to this image. To be more specific, the svg stucture is representing clothing (for example, a T-shirt) and I need to place an image, namely a logo to a specific zone of the svg. Hope that this helps. – Gligor Florin Jan 05 '17 at 14:10

0 Answers0