css怎么做出三角形边框

如图,不是实心的三角,而是两条框的三角

img

问答社区▲禁止灌水,灌水内容请到灌水乐园社区发布!

这种吗?用伪类加个白框挡住下面的

img

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

<style>
 .triangle {
     width:0px;
        height:0px;
        border: 100px solid transparent;
        border-bottom-color: #0082df;
        position: relative;
}
.triangle::after{
  content: "";
  position: absolute;
  right:-100px;
  top:-80px;
  width:0px;
  height:0px;
  border:100px solid transparent;
  border-bottom-color: #fff ;
  z-index: 2;
}
</style>

可以使用标签的伪类after创建一个白色框,定位遮挡下面区域,得到两条框的三角

img

        div {
            width: 200px;
            height: 200px;
            background-color: aquamarine;
            clip-path: polygon(50% 0, 100% 100%, 0 100%);
        }

        div::after {
            position: absolute;
            content: ' ';
            width: 200px;
            height: 200px;
            clip-path: polygon(50% 0, 100% 100%, 0 100%);
            background-color: white;
            top: 10px;
        }

<div></div>