今天设计给了一张svg的图片做背景,但是经过两个小时的纠结,发现就是无法铺满元素,然后经过高人指点,发现是svg图片的原因,百度后果然能解决问题。

解决:

在webstorm里面打开svg图片,然后在svg标签上面加上属性:preserveAspectRatio="none meet";

<svg width="1264px"
height="722px"
viewBox="0 0 1264 722"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
preserveAspectRatio="none meet">

正确答案的链接:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio(某一天我一定能翻译出来,忧桑)

相关文章:

  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-12
  • 2021-12-11
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
相关资源
相似解决方案