美文网首页
SVG图片无法完全铺满

SVG图片无法完全铺满

作者: may505 | 来源:发表于2019-12-25 19:46 被阅读0次

    SVG图片无法完全铺满

    今天设计给了一张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(某一天我一定能翻译出来,忧桑)
    

    相关文章

      网友评论

          本文标题:SVG图片无法完全铺满

          本文链接:https://www.haomeiwen.com/subject/gmasuctx.html