把引用图片用在一个div的背景图中,而不是img标签里
<div class="imgicon"></div>
.imgicon {
background: url('../../../assets/images/path1.png');
//背景图size
background-size: 13.96px;
//div的size
width: 13.96px;
height: 13.96px;
display: flex;
justify-content: center;
扫描二维码关注公众号,回复:
15700899 查看本文章
align-items: center;
}
//悬浮时更换背景图路径
.imgicon:hover {
background: url('../../../assets/images/path2.png');
width: 13.96px;
height: 13.96px;
background-size: 13.96px;
}