如何创建带有背景图像的凹块(例如滑块)?我需要的是:
发布于 2016-01-06 02:35:00
我添加了:pseudo
元素来添加border-radius
的循环效果
.main {
display: inline-block;
text-align: center;
position: relative;
}
.main img {
position: relative;
}
.main div {
position: absolute;
bottom: 0;
width: 100%;
height: 30%;
z-index: 0;
}
.main div:after {
content: '';
width: 150%;
left: -25%;
background: white;
height: 150%;
top: -15%;
position: absolute;
z-index: -1;
border-radius: 50%;
}
<div class="main">
<img src="http://placeimg.com/400/300/animals">
<div>
Vestibulum ante ipsum primis in
</div>
</div>
https://stackoverflow.com/questions/34630603
复制