0
点赞
收藏
分享

微信扫一扫

前端使用elementui开发后台管理系统的常用功能(持续更新)

橙子好吃吗 2023-09-07 阅读 10

 

 1. Border

<div class="triangle"></div>

                .triangle {
                    width: 0;
                    height: 0;
                    border-left: 50px solid transparent;
                    border-right: 50px solid transparent;
                    border-top: 14rpx solid red;
                }

2. transform

.arrow {
  width: 0;
  height: 0;
  border: 50px solid transparent;
  border-right: 50px solid red;
  transform: rotate(45deg);
}

3.  :before 和 :after 伪元素

.arrow {
  position: relative;
}
.arrow:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 50px solid transparent;
  border-bottom: 50px solid transparent;
  border-right: 50px solid red;
}

4. clip-path

.arrow {
  width: 100px;
  height: 100px;
  background-color: red;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
举报

相关推荐

0 条评论