css create 多边形 polygon

案例:   代码:

element.style {
  1.  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属性。
原文地址:https://www.cnblogs.com/hualiu0/p/5315078.html