-2
A
回答
0
请参阅:“SVG is supported in Firefox?”。
CSS的SVG底色转型:
.test:before {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='5' cy='5' r='5' /></svg>");
background-size: cover;
z-index: 1;
transition: opacity 2s;
}
.test:after {
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='20' cy='20' r='10' /></svg>") no-repeat;
background-size: cover;
}
工作段:
.test
{
width: 400px;
height: 300px;
position: relative;
border: 1px solid green;
}
.test:before, .test:after {
content: "";
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
opacity: 1;
}
.test:before {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='5' cy='5' r='5' /></svg>");
background-size: cover;
z-index: 1;
transition: opacity 2s;
}
.test:after {
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='20' cy='20' r='10' /></svg>") no-repeat;
background-size: cover;
}
.test:hover:before {
opacity: 0;
}
<div class="test">
</div>
1
相关问题
- 1. jQuery背景图像转换
- 2. IE8背景大小的解决方法
- 3. 多背景解决方案?
- 4. 将图像转换为背景内容
- 5. CSS3背景图像位置转换
- 6. CSS背景图像转换的后备
- 7. 使用jQuery背景图像转换
- 8. 时间背景图像转换器
- 9. 背景图像上的CSS3转换
- 10. 悬停转换背景图像
- 11. jQuery后备的背景图像转换
- 12. 背景图像位置和CSS转换
- 13. jquery动画背景图像转换
- 14. 背景图像和转换器
- 15. 移动iOS - 固定背景图像解决方案
- 16. 什么是在Gmail中放置背景图像的解决方法?
- 17. 背景图像旋转
- 18. 背景图像旋转器
- 19. CSS3背景图片转换
- 20. 切换背景图像(jQuery)
- 21. 在背景图像背景图像
- 22. 通过php将图像转换为背景图像
- 23. 图像背景减法
- 24. 无法从DialogFragment转换到视图 - 任何解决方法?
- 25. 图像背景
- 26. 背景图像
- 27. 背景图像
- 28. Safari中的CSS转换背景图像跳转盘点
- 29. CSS3转换,要保持背景图像的非旋转
- 30. 背景大小IE解决问题,dublicates图像?
99%* * omplete,** V ** erifiable ** E ** xample)](http://stackoverflow.com/help/mcve)。 请发布与您的问题相关的JavaScript/jQuery,CSS和HTML。使用任何或所有以下服务创建演示: [jsFiddle.net](https://jsfiddle.net/), [CodePen.io](https://codepen.io/), [Plunker。 (http://plnkr.co/), [JS Bin](https://jsbin.com/) 或片段(位于文本编辑器工具栏或CTRL + M上的第7个图标)。 – zer00ne
添加一些代码@kannan –
[** This **](http://caniuse.com/#feat=svg-css)很重要 – Vikrant