Github地址:github.com/Jasonccj/cs…
掘金地址:juejin.im/post/5c6837…
慕課地址:www.imooc.com/article/278…
正方形
.square {
width: 100px;
height: 100px;
background-color: green;
}
複製程式碼

長方形
.rectangle {
width: 200px;
height: 100px;
background-color: green;
}
複製程式碼

銳角三角形
.triangle-acute {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid green;
}
複製程式碼

直角三角形
.triangle-right {
width: 0;
height: 0;
border-left: 50px solid green;
border-right: 50px solid transparent;
border-top: 50px solid transparent;
border-bottom: 50px solid green;
}
複製程式碼

平行四邊形
.rhomboid {
width: 200px;
height: 100px;
margin-left: 30px;
background-color: green;
transform: skewX(30deg)
}
複製程式碼

梯形
.trapezoid {
width: 100px;
height: 0;
border-bottom: 100px solid green;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
複製程式碼

圓形
.circle {
width: 100px;
height: 100px;
background-color: green;
border-radius: 50%;
}
複製程式碼

其他圖形後續不斷更新中!
最後
- 喜歡的記得點個star.鼓勵一下,謝謝!
- 微信 cuixianseni
- qq群號 424072183
