How can I achieve the border effect as shown in the picture?
My previous solution was to use pseudo elements to achieve the effect of a mask layer. But if my background is an image or gradient, it will be difficult to adjust the color of the mask layer. How can I achieve local transparency of the border and directly obtain the background color?
2
Answers
Not sure if this is possible purely with CSS rules, so my solution would be to create an SVG image and set it as the background image.
You can use mask: