<div class="box"></div>
<div class="box"></div>
<div class="box mask"></div>
.box {
--size: 50px;
--p: 25px;
height: 200px;
margin: 5px;
border: 1px solid;
background:
radial-gradient(var(--size) at 50% calc(var(--size) + var(--p)),blue 99%,#0000 101%) calc(50% - 2*var(--size)) 0/calc(4*var(--size)) 100% no-repeat,
radial-gradient(var(--size) at 50% calc(-1*var(--p)),#0000 99%,red 101%) 50% var(--size)/calc(4*var(--size)) 100% no-repeat;
}
.box + .box {
background-repeat: repeat-x;
}
.box.mask {
-webkit-mask:
radial-gradient(var(--size) at 50% calc(var(--size) + var(--p)),blue 99%,#0000 101%) calc(50% - 2*var(--size)) 0/calc(4*var(--size)) 100%,
radial-gradient(var(--size) at 50% calc(-1*var(--p)),#0000 99%,red 101%) 50% var(--size)/calc(4*var(--size)) 100% repeat-x;
background:linear-gradient(90deg,red,blue);
border: none;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.