Looking to construct a single circle using two half circles, each with a different color. Here is an example:
https://i.sstatic.net/hHrOt.png
I have managed to create this effect by utilizing 2 elements and some CSS:
<span class="circle-part half-left-circle"></span>
<span class="circle-part half-right-circle"></span>
and
$size: 100px;
$border: 20px;
...
.half-right-circle {
border-top-right-radius: $size + $border;
border-bottom-right-radius: $size + $border;
border: $border solid green;
border-left: 0;
}
.half-left-circle {
border-top-left-radius: $size + $border;
border-bottom-left-radius: $size + $border;
border: $border solid red;
border-right: 0;
}
Even though this approach works well, I am curious if there is a way to achieve the same result using just one HTML element (without pseudo elements)?