问题
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