I’m trying to give a certain DIV (which contains other elements) rounded edges,I need the other elements inside the DIV to be affected and get the same attribute.
I don’t mean rounded corners which can be achieved with border-radius: Xpx;
like this:
and I don’t mean such a two-dimensional curve either,like this:
I mean a 3-dimensional curve like this:
A relatively simple simulation:
2
Answers
One common way to achieve this is by box-shadow. here is a example:
You can use
mask-image
withlinear-gradient
:Related: Using CSS, can you apply a gradient mask to fade to the background over text?