css实现三角形

<style>
    /*  占据空间是正方形*/
    .test {
      width: 0;
      height: 0;
      border: 50px solid transparent;
      border-top-color: aquamarine;
    }
    /* 不设置border-bottom */
    .triangle{
      width: 0;
      height: 0;
      border-top: 50px solid black;
      border-right: 50px solid transparent;
      border-left: 50px solid transparent;
    }
</style>

  

posted on 2020-08-17 10:51  lizitang  阅读(94)  评论(0编辑  收藏  举报

导航