困境:製作一個完整的窗口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;
,但沒有運氣。
可能重複[如何縮放與
我的帖子在哪裏是'