话不多说直接上代码
div{
width: 0;
height: 0;
border-width: 50px;
border-style: solid;
border-color: red blue green pink;
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/52dd7218b509401a99741c39338c4b29.png)
单个三角形只需要隐藏掉其他的三个就可以了
div{
width: 0;
height: 0;
border-width: 50px;
border-style: solid;
border-color: red transparent transparent transparent;
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/57de7fc6cbfa4fa0bc3e2a6cef7644ab.png)