<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style type="text/css"> *{ background-image: linear-gradient(-135deg, #661a08,#664608,#426608,#44c312,#12c36a, #35e5ce,#3ea1ee,#3e6fee,#6b3eee,#c06eea, #e36eea,#ea6ebd,#ed2b54); text-decoration: dashed; text-align: center; font-size: 2.5rem; } body { display: flex; justify-content: space-around; flex-wrap: wrap; /* background-color:; */ background-color: #000000; } div { width: 300px; height: 200px; background-color: black; border: red solid 2px; margin: 10px; text-decoration: dashed; text-align: center; font-size: 2.5rem; } div:nth-child(1) { background-image: linear-gradient(45deg, red 10%, pink 10%); /* 切角的效果 */ background-image: linear-gradient(45deg, transparent 8%, pink 10%); } div:nth-child(2) { background-image: linear-gradient(45deg, red 10%, pink 10%); /* 切角的效果 */ background-image: linear-gradient(-45deg, transparent 8%, pink 10%); } div:nth-child(3) { /* 切角的效果 */ background-image: linear-gradient(45deg, #00FF99 8%, pink 0%), linear-gradient(-45deg, red 8%, pink 0%); background-size: 100% 100%; background-repeat: no-repeat; } div:nth-child(4) { /* 切角的效果 */ background-image: linear-gradient(45deg, #00FF99 10%, pink 0%); background-image: linear-gradient(45deg, transparent 8%, pink 0%); } div:nth-child(5) { /* 切角的效果 */ background: linear-gradient(45deg, red 10%, pink 0) left, linear-gradient(-45deg, red 8%, green 0) right; background-size: 50% 100%; background-repeat: no-repeat; } div:nth-child(6) { /* 切角的效果 */ background: linear-gradient(45deg, red 10%, pink 0) right, linear-gradient(-45deg, red 8%, green 0) left; background-size: 50% 100%; background-repeat: no-repeat; } /* 切角 */ div:nth-child(7) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, pink 0) right, linear-gradient(-45deg, transparent 8%, green 0) left; background-size: 50% 100%; background-repeat: no-repeat; } div:nth-child(8) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, pink 0) left, linear-gradient(-45deg, transparent 8%, green 0) right; background-size: 50% 100%; background-repeat: no-repeat; } div:nth-child(9) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, yellow 0) left bottom, linear-gradient(-45deg, transparent 10%, red 0) right bottom, linear-gradient(-135deg, transparent 10%, pink) right top, linear-gradient(135deg, transparent 10%, green 0) left top; background-repeat: no-repeat; } div:nth-child(10) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, yellow 0) left bottom, linear-gradient(-45deg, transparent 10%, red 0) right bottom, linear-gradient(-135deg, transparent 10%, pink) right top, linear-gradient(135deg, transparent 10%, green 0) left top; background-size: 50% 50%; background-repeat: no-repeat; } div:nth-child(11) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, green 0) left bottom, linear-gradient(-45deg, transparent 10%, pink 0) right bottom, linear-gradient(-135deg, transparent 10%, blue 0) right top, linear-gradient(135deg, transparent 10%, purple 0) left top; background-size: 50% 50%; background-repeat: no-repeat; } div:nth-child(12) { background-image: linear-gradient(red,blue,yellow); background-image: linear-gradient(45deg, red 10%, pink 10%); /* 切角的效果 */ background-image: linear-gradient(25deg,yellow,red,green,blue,black); background-image: linear-gradient(45deg, transparent 8%, pink 10%); } div:nth-child(13) { background-image: linear-gradient(45deg, red 10%, pink 10%); /* 切角的效果 */ background-image: linear-gradient(-45deg, transparent 8%, pink 10%); } div:nth-child(14) { /* 切角的效果 */ background-image: linear-gradient(45deg, #00FF99 8%, pink 0%), linear-gradient(-45deg, red 8%, pink 0%); background-size: 100% 100%; background-repeat: no-repeat; } div:nth-child(15) { /* 切角的效果 */ background-image: linear-gradient(45deg, #00FF99 10%, pink 0%); background-image: linear-gradient(45deg, transparent 8%, pink 0%); } div:nth-child(16) { /* 切角的效果 */ background: linear-gradient(45deg, red 10%, pink 0) left, linear-gradient(-45deg, red 8%, green 0) right; background-size: 50% 100%; background-repeat: no-repeat; } div:nth-child(17) { /* 切角的效果 */ background: linear-gradient(45deg, red 10%, pink 0) right, linear-gradient(-45deg, red 8%, green 0) left; background-size: 50% 100%; background-repeat: no-repeat; } /* 切角 */ div:nth-child(18) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, pink 0) right, linear-gradient(-45deg, transparent 8%, green 0) left; background-size: 50% 100%; background-repeat: no-repeat; } div:nth-child(19) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, pink 0) left, linear-gradient(-45deg, transparent 8%, green 0) right; background-size: 50% 100%; background-repeat: no-repeat; } div:nth-child(20) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, yellow 0) left bottom, linear-gradient(-45deg, transparent 10%, red 0) right bottom, linear-gradient(-135deg, transparent 10%, pink) right top, linear-gradient(135deg, transparent 10%, green 0) left top; background-repeat: no-repeat; } div:nth-child(21) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, yellow 0) left bottom, linear-gradient(-45deg, transparent 10%, red 0) right bottom, linear-gradient(-135deg, transparent 10%, pink) right top, linear-gradient(135deg, transparent 10%, green 0) left top; background-size: 50% 50%; background-repeat: no-repeat; } div:nth-child(22) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, green 0) left bottom, linear-gradient(-45deg, transparent 10%, pink 0) right bottom, linear-gradient(-135deg, transparent 10%, blue 0) right top, linear-gradient(135deg, transparent 10%, purple 0) left top; background-size: 50% 50%; background-repeat: no-repeat; } div:nth-child(24) { /* 切角的效果 */ background: linear-gradient(45deg, transparent 10%, green 0) left bottom, linear-gradient(-45deg, transparent 10%, pink 0) right bottom, linear-gradient(-135deg, transparent 10%, blue 0) right top, linear-gradient(135deg, transparent 10%, purple 0) left top; background-size: 50% 50%; background-repeat: no-repeat; } </style> <title></title> </head> <body> <!-- div*24+tab --> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </body> </html>