I know this is an old one, but I'd like to add to this discussion that There are at least 5 different methods for creating a triangle using HTML & CSS alone.
borders
linear-gradient
conic-gradient
transform
and overflow
clip-path
I think that all have been covered here except for method 3, using the conic-gradient
, so I will share it here:
.triangle{_x000D_
width: 40px;_x000D_
height: 40px;_x000D_
background: conic-gradient(at 50% 50%,transparent 135deg,green 0,green 225deg, transparent 0);_x000D_
}
_x000D_
<div class="triangle"></div>
_x000D_