SVG display difference between >

前端 未结 1 1664
栀梦
栀梦 2021-01-26 08:59

What\'s the difference between displaying a SVG image in an or tag? I was facing some problems using SVG images in a &
1条回答
  •  孤城傲影
    2021-01-26 09:39

    Differences when SVG is used as an image (html SVG or CSS background images)

    • no scripting
    • no interactivity
    • no external dependencies (complete in a single file)
    • no DOM (i.e. no script access into them from outside)
    • can be copied into canvas via drawImage

    I suspect you're suffering from the no external dependencies rule. You may also want to check that the SVG data has a preserveAspectRatio attribute on the root element and if it does that the value of that attribute is not none.

    0 讨论(0)
提交回复
热议问题