我已经看到了一些围绕这个问题的问题,所以我希望这不是多余的。理想情况下,我想要一个image/svg+xml
100% 的容器。
Colorzilla让我有了一个很好的开始data:image/svg+xml
<?xml version="1.0" ?>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">
<linearGradient id="grad-ucgg-generated" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#ffffff" stop-opacity="0"/>
<stop offset="100%" stop-color="#ff0000" stop-opacity="1"/>
</linearGradient>
<rect x="0" y="0" width="1" height="1" fill="url(#grad-ucgg-generated)" />
</svg>
注意:width="100%" height="100%"
我想采用这个渐变并旋转它,比如说65deg
HTML5 canvas API 为我提供了一种很好的方式来构建这个图像,然后使用.toDataURL()
PNG 来填充 IE8 和 IE7,但我想要一些可扩展的 IE9 .
所以目标是复制这个:
background: linear-gradient(bottom, rgba(239, 239, 214,0) 0%, rgba(239, 239, 214,.8) 100%),
linear-gradient(left, rgba(239, 239, 214,0) 60%,rgba(207, 223, 144,1) 100%),
linear-gradient(right, rgba(239, 239, 214,0) 0%,rgba(239, 239, 214,1) 60%),
linear-gradient(top, rgba(239, 239, 214,0) 60%,#cfdf90 100%);
}
具有image/svg+xml
100% 的宽度和高度。
我确实尝试了http://svg-edit.googlecode.com,但对于我想要做的编辑类型,界面不太直观。谢谢!