美文网首页
svg作为background失效

svg作为background失效

作者: Asuler | 来源:发表于2020-08-05 19:20 被阅读0次

svg代码抽出来,新建一个svg文件粘贴进去,发现在css的background引入无效

解决方案
svg对应的文件的代码漏了一个xmlns="http://www.w3.org/2000/svg" 属性,加上即可

<svg xmlns="http://www.w3.org/2000/svg"  xxxxx>
<path>xxxxxxxxx</path>
</svg>

相关文章

  • svg作为background失效

    svg代码抽出来,新建一个svg文件粘贴进去,发现在css的background引入无效 解决方案svg对应的文件...

  • svg引入方式及资料推荐

    一、引入方式 1、使用img、object、embed 标签或者作为background背景图直接引用svg; 缺...

  • 如何兼容模式画0.5px的线

    方案 svg + base64 .hr.svg {background: none;height: 1px;ba...

  • icon 小记

    生成icon的方法有: img 法 background 法 background合一 法 font 法 SVG ...

  • icon 全解

    icon 的各种做法 img 法 background 法 background 合一法 font 法 SVG 法...

  • icon的所有方案

    icon 的各种做法 img 法 background 法 background 合一法 font 法 SVG 法...

  • Svg Sprite

    演示地址 代码 SVG Sprite 传统的做法使用AI或者合并SVG图像,然后用background-posti...

  • 实现background-size: cover的几种方法

    background实现 img标签实现 svg实现 codepen 中自己试试吧

  • 书写0.5px线条方式:

    方法1: .border_top { background: url("data:image/svg+xml;ut...

  • icon的几种做法

    方法:1.img法2.background法3.background合一法4.font法5.SVG法6.新手慎用【...

网友评论

      本文标题:svg作为background失效

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