如何将图案拉伸至100%宽度和高度?
FIDDLE http://jsfiddle.net/unegvgao/
<pattern patternUnits="userSpaceOnUse" id="pat1" x="0" y="0" width="100%" height="100%">
<image width="100%" height="100%" xlink:href="http://img.wallpaperstock.net:81/fire-reflection-wallpapers_12396_1280x960.jpg" />
</pattern>
答案 0 :(得分:1)
将preserveAspectRatio属性添加到图像元素 http://jsfiddle.net/defghi1977/x4c1qhwu/
<pattern patternUnits="userSpaceOnUse" id="pat1" x="0" y="0" width="100%" height="100%">
<image preserveAspectRatio="none" width="100%" height="100%" xlink:href="http://img.wallpaperstock.net:81/fire-reflection-wallpapers_12396_1280x960.jpg" />
</pattern>