Realization of right triangle by CSS

Time:2021-3-5

Mainstream browsers basically support it

Realization of right triangle by CSS

<div class="triangle"></div>
.triangle{
    height: 200px;
    width: 200px;
    background-image: linear-gradient(to bottom right,red 50%, transparent 50%);
}