<div class="list">
<div class="item"><img src="alipay.jpg" alt="logo"></div>
</div>
.item {
width: 175px;
height: 75px;
border: 1px solid #f4f4f4;
margin-bottom: 75px;
position: relative;
z-index: 10;
cursor: pointer;
transition: all 0.5s;
&:hover::before {
content: 'alipay';
color: #fff;
text-align: center;
background-color: #4285f4;
opacity: 0.9;
width: 100%;
height: 100%;
display: block;
position: absolute;
z-index: 10;
font-size: 30px;
padding: 10px 0;
}
过渡效果没有生效,如何给伪类加过度,或者在不添加额外标签的情况下实现这个效果
慕尼黑5688855
相关分类