border-radius
和transform: skew()
来实现该效果。通过对元素进行倾斜,边框半径效果仍然保留在角落中。div {
width: 150px;
height: 150px;
position: relative;
background: lightblue;
border-radius: 8px;
margin-left: 30px;
}
div::before {
position: absolute;
left:0;
top: 20px;
content: "";
width: 40px;
height: 40px;
border-radius: 8px;
background: lightblue;
transform: skew(50deg);
}
<div></div>