css create 多边形 polygon

案例:   代码:

element.style {
  1. width: 0;
  2. height: 0;
  3. /* border-left: 50px solid transparent; */
  4. border-right: 50px solid #383030;
  5. border-bottom: 100px solid green;
}
分析:
css 当width 为 0,height为0, border不同时,不同的border为solid时就分冲突空间,而后会均分空间,要想实现多边形,可以把某个边设置为 solid transparent透明可以实现。
另,实现椭圆,使用border-radius可用。 border-radius: 100px, 50px; 或者要实现 此现在可以使用rotate css3属性。
posted @ 2016-03-24 13:05  calochCN  阅读(1044)  评论(0编辑  收藏  举报