We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.triangle { width: 0; height: 0; border-width: 100px; border-style: solid; border-color: red transparent transparent transparent;/*倒三角*/ }
.circle { width: 100px; height: 100px; background: yellow; border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%; -o-border-radius: 50%; }
.ellipse { width: 200px; height: 100px; background: green; border-radius: 100px / 50px; -webkit-border-radius: 100px / 50px; -moz-border-radius: 100px / 50px; -o-border-radius: 100px / 50px; }
.egg { width: 136px; height: 190px; background: #ffc000; -webkit-border-radius: 68px 68px 68px 68px / 114px 114px 76px 76px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.heart { position: relative; left: 50px; width: 100px; height: 100px; background: red; transform: rotate(-45deg);/*逆时针旋转45度*/ } .heart:before {/*正方形上边绘制圆形*/ position: absolute; content: ''; top: -50px; left: 0; width: 100px; height: 100px; background: red; border-radius: 50%; } .heart:after {/*正方形右边绘制圆形*/ position: absolute; content: ''; top: 0; left: 50px; width: 100px; height: 100px; background: red; border-radius: 50%; }
.sector { width: 0; height: 0; border-width: 100px; border-style: solid; border-color: blue transparent transparent transparent; border-radius: 100px; -webkit-border-radius: 100px; -moz-border-radius: 100px; -o-border-radius: 100px; }
.diamond { position: relative; top: -50px; width: 0; height: 0; border: 50px solid transparent; border-bottom-color: yellowgreen; } .diamond:after { position: absolute; content: ''; left: -50px; top: 50px; width: 0; height: 0; border: 50px solid transparent; border-top-color: yellowgreen; }
.five-star { position: relative; width: 0; height: 0; border-left: 100px solid transparent; border-right: 100px solid transparent; border-bottom: 70px solid red; transform: rotate(35deg); } .five-star:before { position: absolute; top: -45px; left: -65px; content: ''; width: 0; height: 0; border-left: 30px solid transparent; border-right: 30px solid transparent; border-bottom: 80px solid red; transform: rotate(-35deg); } .five-star:after { position: absolute; top: 3px; left: -105px; content: ''; width: 0; height: 0; border-left: 100px solid transparent; border-right: 100px solid transparent; border-bottom: 70px solid red; transform: rotate(-70deg); }
参考:https://juejin.im/post/6844903809064386567
The text was updated successfully, but these errors were encountered:
No branches or pull requests
一、绘制三角形
二、绘制圆形
三、绘制椭圆
四、绘制蛋形
五、心形
六、扇形
七、菱形
八、五角星
参考:https://juejin.im/post/6844903809064386567
The text was updated successfully, but these errors were encountered: