One creative approach is to utilize the CSS property background-attachment: fixed
to apply a gradient to each element, resulting in the appearance of a single cohesive gradient across all elements:
.container {
display: flex;
justify-content: space-around;
position: relative;
z-index: 0;
background: linear-gradient(to left, #4747f6 0%, #f27d66 100%) center/100% 4px no-repeat;
}
.container>div {
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(to left, #4747f6 0%, #f27d66 100%) fixed;
}
.container:before,
.container:after {
content: "";
position: absolute;
z-index: -1;
top: calc(50% - 5px);
height: 10px;
left: 0;
width: 10px;
border-radius: 50%;
background: linear-gradient(to left, #4747f6 0%, #f27d66 100%) fixed;
}
.container:after {
right: 0;
left: auto;
}
body {
margin: 0;
}
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>