我正在尝试在scss中创建一个混入,它将帮助我处理svg作为背景,并回退到旧浏览器的png。
问题是它不起作用。我只有一个这样的css文件
@mixin background-svg-support($png, $svg) {
background: transparent url($png) center center no-repeat;
background-image: -webkit-linear-gradient(transparent, transparent), url($svg);
background-image: linear-gradient(transparent, transparent), url($svg);
}
.bg {
height: 800px;
width: 800px;
@inlude background-svg-support('http://bit.ly/14U3Qui', 'http://bit.ly/99Xewi');
}但是无论如何,我都不能在我的.bg类中拥有backgrounds属性。这是怎么回事?Here is the codepen link
发布于 2013-07-12 17:13:19
好吧,没关系,我写的是@inlude而不是@include。它现在可以正常工作了。
我也更正了codepen,使其正常工作。
https://stackoverflow.com/questions/17611313
复制相似问题