使用CSS绘制几何图形(圆形、三角形、扇形、菱形等)
//圆形 <div class="circle"></div> <style> .circle { border-radius: 50%; width: 80px; height: 80px; background: #666; } //扇形 <div class="sector"></div> <style> .sector{ border-radius:80px 0 0; width: 80px; height: 80px; background: #666; } </style> //三角形 <style> #triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid red; } </style> //菱形 .rhombus{ width: 100px; height: 100px; transform: rotateZ(45deg)skew(30deg,30deg); background: blue; }
标签:几何图形,height,width,HTML,80px,菱形,border,CSS From: https://www.cnblogs.com/alwaysrun/p/17180982.html