简体   繁体   English

IMG既不显示SVG图像也不显示背景图像

[英]SVG Image neither displayed by IMG nor Background Image

I can't get the SVG Image to disaply correctly in Google Chrome 34 我无法在Google Chrome 34中正确显示SVG图片

Example

As you can see object and iframes are working. 如您所见,对象和iframe都在工作。 IMG and Backgroudn image aren't working. IMG和Backgroudn图像无效。

IE11 and FireFox can display all 4 examples correct. IE11和FireFox可以正确显示所有四个示例。

The Chrome developers have chosen not to support the use of SVG fragments in images in order to protect user's privacy. Chrome开发人员选择不支持在图像使用SVG片段,以保护用户的隐私。

Because your SVG file only displays each shape if it is the target of a URL fragment (the part after # in the filename), nothing is displayed when Chrome strips out the fragment. 由于您的SVG文件仅在URL片段(文件名中#后面的部分)的目标位置时才显示每个形状,因此Chrome剥离片段时将不显示任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM