您可以创建包装,将包含图像和标签,如下所示: https://jsfiddle.net/9e7h2LLf/
.wrapper{
border-radius: 50%;
border: 2px solid red;
height: 100px;
width: 100px;
overflow: hidden;
position: absolute;
}
img {
height: 100px;
width: 100px;
}
.label {
background-color: red;
height: 30px;
line-height: 30px;
width: 100%;
position: absolute;
bottom: 0px;
color: white;
text-align: center;
}
<div class="wrapper">
<img src="https://image.freepik.com/free-vector/bathroom-mosaic-pattern_23-2147497370.jpg">
<span class="label">1</span>
</div>
或者创建一个圆形包装,并使用图像作为背景,喜欢这里: https://jsfiddle.net/3jmfcudo/
.wrapper{
border-radius: 50%;
border: 2px solid red;
height: 100px;
width: 100px;
overflow: hidden;
background-image: url("https://image.freepik.com/free-vector/bathroom-mosaic-pattern_23-2147497370.jpg");
background-size: contain;
position: absolute;
}
.label {
background-color: red;
height: 30px;
line-height: 30px;
width: 100%;
position: absolute;
bottom: 0px;
color: white;
text-align: center;
}
<div class="wrapper">
<span class="label">1</span>
</div>
请提供[** ** MVCE(http://stackoverflow.com/help/mcve) 。您需要至少显示您迄今为止尝试过的代码。 – Ricky
好的,谢谢,我已经添加了我的代码。 –