【发布时间】:2013-12-19 22:34:02
【问题描述】:
我正在尝试将 SVG 缩放为它的父级(主体)的全宽,并且由于某种原因它不会在 chrome/safari 上让步 - 但适用于 Firefox
<svg class="svg-graphic" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100">
<defs>
<pattern id='image' width="100%" height="140%" viewBox="0 0 100 100" preserveAspectRatio="none">
<image xlink:href='http://25.media.tumblr.com/28c4327f8d41f73e2ed6ccdf7da27efb/tumblr_mw4knrtHlH1qz7p1oo1_500.jpg' width="100" height="100" preserveAspectRatio="none"></image>
</pattern>
</defs>
<polygon points="0, 0, 0, 5, 25, 40, 50, 5, 75, 40, 100, 5, 100, 0,)" fill="url(#image)" />
</svg>
CSS
html, body {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin:0;
padding:0;
}
.svg-graphic {
position: fixed;
top:0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
}
关注这个帖子here
【问题讨论】: