Using SVG as background image

后端 未结 5 843
忘掉有多难
忘掉有多难 2020-12-12 20:55

I can\'t seem to get this to work as desired. My page changes height based on what content is loaded and if it requires a scroll, the svg doesn\'t seem to be stretching...

5条回答
  •  情话喂你
    2020-12-12 21:13

    You can try removing the width and height attributes on the svg root element, adding preserveAspectRatio="none" viewBox="0 0 1024 800" instead. It makes a difference in Opera at least, assuming you wanted the svg to stretch to fill the entire region defined by the CSS styles.

提交回复
热议问题