一、单切角
方法:
background: #58a;
background: linear-gradient(-45deg,transparent 15px,#58a 0);
二、双切角
方法:
background: #58a;
/*right设置切角放置在右下角*/
background: linear-gradient(-45deg,transparent 15px,#58a 0) right,
linear-gradient(45deg,transparent 15px,#655 0) left;
/*两个角重叠在一起*/
background-size: 50% 100%;
/*平铺了2次*/
background-repeat: no-repeat;
三、四切角
方法:
background: #58a;
background: linear-gradient(-45deg,transparent 15px,#58a 0) bottom right,
linear-gradient(45deg,transparent 15px,#58a 0) bottom left,
linear-gradient(135deg,transparent 15px,#58a 0) top left,
linear-gradient(-135deg,transparent 15px,#58a 0) top right;
background-size: 50% 50%;
background-repeat: no-repeat;
四、四切弧角
方法:
background: #58a;
background: radial-gradient(circle at bottom right ,transparent 15px,#58a 0) bottom right,
radial-gradient(circle at bottom left ,transparent 15px,#58a 0) bottom left,
radial-gradient(circle at top left ,transparent 15px,#58a 0) top left,
radial-gradient(circle at top right ,transparent 15px,#58a 0) top right;
background-size: 50% 50%;
background-repeat: no-repeat;
声明:以上方法参考《CSS揭秘》