每次需要自己写三角形,都是百度,现在自己总结一个,以后可以看自己的。
div{ width:0; border:100px solid; border-color:red transparent transparent transparent; border-width:calc(100px*1.733) 100px 0 100px; }
具体可以根据实际需求进行调整
css编写一个三角形
原文:https://www.cnblogs.com/chao202426/p/11325313.html