I think that only CSS Gradient can be used. Since I'm not very good with gradients, I used the CSS online gradient generator and did the following:
CSS
.triangle { width: 300px; border: 1px solid black; background-image: -webkit-gradient(linear, left top, left top, color-stop(0, #000000), color-stop(0.5, #FFFFFF)); background-image: -o-linear-gradient(left top, #000000 0%, #FFFFFF 50%); background-image: -moz-linear-gradient(left top, #000000 0%, #FFFFFF 50%); background-image: -webkit-linear-gradient(left top, #000000 0%, #FFFFFF 50%); background-image: -ms-linear-gradient(left top, #000000 0%, #FFFFFF 50%); background-image: linear-gradient(to left top, #000000 0%, #FFFFFF 50%); }
Working script
Connected
source share