Create CSS triangles using borders
Triangle Direction
Size
Color
Preview
CSS (Border Method)
.triangle {
width: 0;
height: 0;
border-left: 40px solid transparent;
border-right: 40px solid transparent;
border-bottom: 80px solid #3b82f6;
}CSS (Clip-path Method)
.triangle {
width: 80px;
height: 80px;
background-color: #3b82f6;
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}HTML
<div class="triangle"></div>
Quick Select