CSS伪元素设置背景图片不显示解决
&::after{
position: absolute;
bottom: 0;
right: -13px;
width: 40px;
height: 40px;
background: url("../../assets/images/music.jpg") no-repeat;
background-size: contain;
border-radius: 50%;
transition: background 0.3s ease-in;
content: '';
}
注意:不满足以下任一条件无法显示图片
- 必须要有 content: '';
- 必须要有背景图片 background: url('....');
- 必须要有宽高
- 必须要加一个 background-size