Impossible with HTML, but with CSS. Example:
<div class="triangle></div>
.triangle { width: 0; height: 0; border: solid 30px; border-color: transparent transparent black transparent; }
Live demo: jsFiddle
30px in the border property determines the size: width and height. You can change it if you want a smaller or larger triangle.- if you want to rotate the triangle, switch the position of
black and transparent in the border-color property. See jsFiddle
source share