Trying to achieve a square with three colors inspired by the concept of a Two-tone background split by diagonal line using css, but with an additional color scheme similar to this example:
https://i.sstatic.net/ci2Zv.png
Seeking advice. Attempted the following CSS:
.diagonal-box {
width: 200px;
height: 200px;
position: relative;
}
.diagonal-box:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 0 200px 200px;
border-color: transparent transparent #FF7F50;
}
.diagonal-box:after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 200px 200px 0;
border-color: transparent #00BFFF transparent;
}
.diagonal-box div {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 200px 200px 0 0;
border-color: #7CFC00 transparent transparent transparent;
}
<div class="diagonal-box">
<div></div>
</div>
However, the triangles are not aligned as desired.