当使用 SVG 作为背景图像时,如果我需要正确地适应图像,则必须为不同的浏览器指定单独的背景位置。
是我经历的方式,还是我做错了什么。
我尝试使用的 CSS:
.some {
background: transparent url('some.png') no-repeat -X1px -Y1px;
background: rgba(0,0,0,0) url('some.svg') no-repeat -X2px -Y2px;
width: 53px;
height: 14px;
position: relative;
top: 13px;
left: 30px;
}
最佳答案
您如何尝试将背景图像应用到您的 html 文档?
如果你使用它应该就可以工作:
background-cover:cover;
不确定为什么要这样定位 BG。
关于css - SVG 作为背景图像,跨浏览器兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18443331/