困境:制作一个完整的窗口svg图像,填充WITH aspect变形,而不使用SVG标签。为什么没有svg标签?因为我打算在页面生命周期之后(如果不是频繁的话)更换SVG,并且我还没有找到一个简单的方法来做到这一点。全宽和高SVG
失败尝试:
<!-- for the record, my style are in a css file,
for example purposes they are style attrs-->
<!-- Working in Webkit but not in firefox, in firefox blocks stretching
and places the svg in the middle of the tag-->
<img src="my.svg" style="width:100%;height:100%;
position:fixed;top:0;left:0;bottom:0;right:0;" />
<!-- Both Webkit and Firefox block distortion, so the svg
appears centered in the div rather than conforming to the div-->
<div style="width:100%;height:100%;position:fixed;top:0;
left:0;bottom:0;right:0;background-size:cover;
background-image:url(my.svg);" />
我也曾尝试
background-size:contain;
background-size:cover;
background-size:100% 100%;
background-postion: center center;
,但没有运气。
可能重复[如何缩放与
我的帖子在哪里是'