html - Svg image does not show in Firefox -


inside simple svg element have image.

  • chrome: version 28. - works perfect
  • firefox: 22.0 - no image drawn
  • opera: 12.16 - image show 4 times larger normal

code:

     <svg width="500px" height="500px" viewbox="0 0 70 70">          <image x="0" y="0" width="10" height="10"                 id="knight" xlink:href="/images/knight.svg" />     </svg> 

your svg not being scaled fit 10x10 image rectangle because has no viewbox. svg renderers need know dimensions of svg content in order know how scale it. viewbox attribute for.

try adding following root <svg> element in knight.svg.

  viewbox="0 0 45 45" 

also, need define namespaces svg , xlink. although perhaps have removed clarity(?).


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -