/*关键语句*/
clip-path: polygon(0 0, 0% 100%, 100% 100%, 100% 20%, 90% 0%);
例子
/*例子1*/
.title {
font-size: 2rem;
line-height: 3rem;
height: 3rem;
padding: 0 1rem 0 .4rem;
background: #fff;
clip-path: polygon(0 0, 0% 100%, 100% 100%, 100% 20%, 90% 0%);
-webkit-clip-path: polygon(0 0, 0% 100%, 100% 100%, 100% 20%, 90% 0%);
}
/*例子2*/
.name {
width: 100%;
height: 5.6rem;
color: #bfc8db;
display: flex;
justify-content: center;
align-items: center;
clip-path: polygon(5% 0, 0% 12%, 0% 100%, 100% 100%, 100% 0%);
-webkit-clip-path: polygon(5% 0, 0% 12%, 0% 100%, 100% 100%, 100% 0%);
}
效果图:
可以发现,坐标点是按照逆时针顺序,首尾相连的.没有始终点之分.
--by Affandi ⊙▽⊙