I have made some circle div which is present in the main rectangle div just -margin top is given now i want to remove their background colour just from the marked red area
I have tried this approach
.circleCut {
-webkit-mask-image: radial-gradient(
circle at 75% top,
transparent 30px,
black 31px
);
}
which is making a perfect cut in the box but hiding my circles and how can I apply that circlcut
class on a same div multiple times
2
Answers
You can use a background and control its size and position to achieve this. I am using CSS variables so you don’t have to manually adjust the calculation. All you have to do is to update the variables.
I am also adding the rounded element to complete the demo:
Set the parent element background at two different colors:
Then set the border color of each circle to the same color of the top color of parent element: