我有以下 css,它在另一个图形的顶部显示一个小图形,它适用于除 Firefox 之外的所有浏览器。在 Firefox 上会出现一个黄色的小框,但没有图像。我能做些什么让它也出现在 Firefox 上吗?
.post-content-contract {
background: rgba(255, 255, 0, 1) none repeat scroll 0 0;
opacity: 1;
top:5%;
left:5%;
max-width: 50%;
max-height: 50%;
position: absolute;
color: #ffffff;
content:url(contract.png);
}
content
不打算以这种方式使用。它的使用仅限于:before
和:after
伪元素。
在您的情况下,最好的选择是background-image
改用:
.post-content-contract {
background-image: url(contract.png);
background-size: cover;
width: 100px;
height: 80px;
...
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句