This article collects content from network
{ width: 0; height: 0; border-left: 50px solid Transparent; border-right: 50px solid Transparent; border-bottom: 100px solid red;}
{ width: 0; height: 0; border-left: 50px solid Transparent; border-right: 50px solid Transparent; border-top: 100px solid red;}
{ width: 0; height: 0; border-top: 50px solid Transparent; border-right: 100px solid red; border-bottom: 50px solid transparent;}
{ width: 0; height: 0; border-top: 50px solid Transparent; border-left: 100px solid red; border-bottom: 50px solid transparent;}
{ width: 0; height: 0; border-top: 100px solid red; border-right: 100px solid transparent;}
{ width: 0; height: 0; border-top: 100px solid red; border-left: 100px solid transparent;}
{ width: 0; height: 0; border-bottom: 100px solid red; border-right: 100px solid transparent;}
{ width: 0; height: 0; border-bottom: 100px solid red; border-left: 100px solid transparent;}
<!--Outer frame -<Divclass= "Mod-container"> <!--Small Triangle Part - <Divclass= "Mod-triangle"> <Divclass= "T-border"></Div> <Divclass= "T-inset"></Div> </Div></Div>
/*Outer box Container*/. Mod-container{width:100px;Height:60px;Border:1px solid #000;margin:20px;background:#fff;}/*Small Triangle Part*/. Mod-triangle{Display:Block;position:relative; Left:-23px;Top:18px;Z-index: -;}. Mod-triangle. T-border,.mod-triangle. T-inset{ Left:0px;Top:0px;width:0;Height:0;font-size:0;Overflow:Hidden;position:Absolute;Border-width:12px;/*Here you can change the direction of the small triangle: top-right-bottom-left (solid position)*/Border-style:dashed solid dashed dashed;}/*the border of the small triangle, if not needed, can change the color value*/. Mod-triangle. T-border{Border-color:transparent #000 Transparent transparent; Left:-1px;}. Mod-triangle. T-inset{Border-color:transparent #fff Transparent transparent;}
CSS Implementation div triangle