SVG linear gradient dont work in ie11

橙三吉。 提交于 2020-04-30 07:48:19

问题


I have this gradient code in an SVG-File:

<linearGradient id="SVGRD" gradientUnits="userSpaceOnUse" x1="-243.3" y1="1257.3" x2="-242.3" y2="1257.3" gradientTransform="matrix(-64.7347 -199.2328 -199.2328 64.7347 234813.9219 -129743.9844)">
  <stop  offset="0" style="stop-color:#B3B3B3"/>
  <stop  offset="0.45" style="stop-color:#B3B3B3;stop-opacity:0.22"/>
  <stop  offset="1" style="stop-color:#B3B3B3;stop-opacity:0"/>
</linearGradient>
<path style="fill:url(#SVGRD);" d="M142.7,133L105,18.5H0V133H142.7z"/>

It dont seem to work in IE11. The path is rendered without gradient and fill color only.

The SVG is implemented as an image. Any suggestions? Thanks in advance!


回答1:


The gradient has no vector (x1=x2 and y1=y2). According to the SVG specification this degenerate case should result in a single colour which is the last stop colour.

If that's what IE is displaying then it's entirely correct to do so. It's certainly what Firefox will display given such a gradient.



来源:https://stackoverflow.com/questions/38902420/svg-linear-gradient-dont-work-in-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!