1

When I try to show .svg files as an image, Chrome would not show it when I tried to write it like this:
<img src='/images/shape.svg'>

I found that .svg is often not rendered well by Google Chrome, but you could use <object> instead (found that here).
Now the <object>-tag is working for me on all cases and pages, but this one. I don't know why, but something makes my images/objects shift up and down inside its own container. As you can see on this inspector here.

!! the <svg> and the <object> on the right image are the same height in the inspector
inspector

UPDATE: also, it is not always the right one that renders and the rest not. It is literally completely random. Sometimes 1 and 4 render correct, sometimes only 3, sometimes none, ...

I have put my code in this fiddle Thanks for any help on this

nclsvh
  • 2,628
  • 5
  • 30
  • 52
  • Your pen doesn't reproduce the described behavior for me, even when the protocol issue is resolved. Can you include a link to the real svg file? Also, is there really only an `` in this svg? Why wrap it in svg? – Kaiido Sep 12 '17 at 08:56
  • I will try to reproduce the error in Codepen or somewhere else, later today. Well, when I wrap it in ``tag it won't show at all in Chrome.. – nclsvh Sep 12 '17 at 10:04
  • While trying to reproduce it in JSFiddle I found out it was fixed when adding a height in px for the ``.. Thanks anyway for the reply – nclsvh Sep 13 '17 at 11:04

0 Answers0