Square(正方形)
#square{ width:100px; height:100px; backgroud:red; }
Rectangle(矩形)
#rectangle { width: 200px; height: 100px; background: red;
Circle(圓形)
#circle { width: 100px; height: 100px; background: red; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; }
/ 可以使用百分比值(大於50%),但是低版本的Android不支援/
Oval(橢圓形)
#oval { width: 200px; height: 100px; background: red; -moz-border-radius: 100px / 50px; -webkit-border-radius: 100px / 50px; border-radius: 100px / 50px; }
/ 可以使用百分比值(大於50%),但是低版本的Android不支援/
le Up (向上的三角形)
#triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid red; }
Triangle Down(向下)
#triangle-down { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-top: 100px solid red; }
Triangle
#triangle-left { width: 0; height: 0; border-top: 50px solid transparent; border-right: 100px solid red; border-bottom: 50px solid transparent; }
CSS繪製各種圖形的方法
Square(方形)
#triangle-right { width: 0; height: 0; border-top: 50px solid transparent; border-left: 100px solid red; border-bottom: 50px solid transparent; }
#square{ width:100px; height:100px; backgroud:red; }
/可以使用百分比值(大於50%),但是低版本的Android不支援/
#rectangle { width: 200px; height: 100px; background: red;/ 可以使用百分比值(大於50%),但低版本的Android不支援/
#circle { width: 100px; height: 100px; background: red; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; }
#oval { width: 200px; height: 100px; background: red; -moz-border-radius: 100px / 50px; -webkit-border-radius: 100px / 50px; border-radius: 100px / 50px; }Triang ight(向右)
#triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid red; }更多CSS繪製各種圖形的方法相關文章請關注PHP中文網!