1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>多边形案例</title> <style> .line { display: flex; align-items: center; background-color: rgb(164, 192, 245); } .leaf { height: 152px; width: 200px; clip-path: inset(10px round 152px 5px); line-height: 152px; background-color: cadetblue; text-align: center; } .shanbei { height: 152px; width: 200px; clip-path: inset(10px round 20px 10px 150px); line-height: 152px; background-color: cadetblue; text-align: center; } .roundjuxing { height: 152px; width: 200px; clip-path: inset(10px 20px 10px 30px round 20px); line-height: 152px; background-color: cadetblue; text-align: center; } .circle1 { width: 200px; height: 200px; background-color: #ffb700; margin-right: 40px; text-align: center; clip-path: circle(6rem at right center); } .circle2 { width: 200px; height: 200px; background-color: #ffb700; text-align: center; margin-right: 40px; clip-path: circle(10% at 2rem 90%); } .circle3 { width: 200px; height: 100px; background-color: #ffb700; margin-right: 40px; text-align: center; clip-path: circle(closest-side at 50% 50%); } .circle4 { width: 200px; height: 100px; background-color: #ffb700; text-align: center; margin-right: 40px; clip-path: circle(farthest-side at 50% 50%); } .ellipse1 { width: 300px; height: 200px; text-align: center; background-color: steelblue; clip-path: ellipse(4rem 50% at right center); } .ellipse2 { width: 300px; height: 200px; text-align: center; background-color: steelblue; clip-path: ellipse(closest-side closest-side at 50% 68%); } .ellipse3 { width: 300px; height: 200px; text-align: center; background-color: steelblue; clip-path: ellipse(farthest-side farthest-side at 50% 68%); } .polygon1 { width: 300px; height: 200px; text-align: center; background-color: rgb(243, 117, 0); clip-path: polygon( 0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75% ); } .path1 { width: 300px; height: 300px; text-align: center; background-color: rgb(243, 117, 0); clip-path: path( 'M 150 0 L 184 112 L 300 112 L 207 175 L 241 288 L 150 225 L 59 288 L 93 175 L 0 112 L 116 112 Z' ); } </style> </head> <body> <div class="line"> <span>inset</span> <div class="leaf">叶子</div> <div class="shanbei">扇贝</div> <div class="roundjuxing">圆角矩形</div> </div> <div class="line"> <span>circle</span> <div class="circle1">方向值偏移</div> <div class="circle2">数值偏移</div> <div class="circle3">closest-side</div> <div class="circle4">farthest-side</div> </div> <div class="line"> <span>ellipse</span> <div class="ellipse1">方向值偏移</div> <div class="ellipse2">closest-side</div> <div class="ellipse3">farthest-side</div> </div> <div class="line"> <span>polygon</span> <div class="polygon1">对话框</div> </div> <div class="line"> <span>path</span> <div class="path1">五角星</div> </div> </body> </html>
|