Here is the css
body {
font-family: sans-serif;
border: solid 1px;
padding: 10px;
border-radius: 20px;
box-shadow: rgb(195, 197, 199) 0px 23px 0px -15px,
rgb(217, 217, 213) 0px 45px 0px -30px;
}
The border radius on the second layer is not inherited from the parent’s border radius as you can see in the image below.
Thanks for your help in advance.
2
Answers
I had the same problem once, but after a lot of testing it never really worked as I wanted it to.
The only way I managed to resolve my problem, is by adding the first shadow via :after pseudo-element and adding another shadow to that.
Negative values for spread-radius reduce the size of the shadow. It would makes sense for the border-radius of the shadow to be reduced proportionally, but it seems that the border-radius is being reduced more than it should be. And it certainly doesn’t generate the visual effect that you want in this case.
The easiest workaround may be to reduce your negative spread radius, or increase your border radius. Either of these will result in more rounded shadow corners.
Or, as @CristophKern says, instead of
box-shadow
you could use pseudo-elements, which give you more control over their position and shape.