For me, it looks like something that can be achieved with a pair of elements, as shown below. A shadow is a linear-gradient
over which a white circle is placed. The disadvantage of this approach is that it will only work with a solid background (because a solid color will be required for the overlaid circle).
It just doesn't look like it's possible using box-shadow
, because the shadow itself seems like a gradient that goes from transparent or white on the left to black in the middle, to transparent or white again on the right.
The output is responsive and can adapt to all sizes of the parent container. Simple :hover
container in the fragment to see it in action :)
.wrapper { position: relative; height: 200px; width: 200px; overflow: hidden; } .content { height: 85%; width: 100%; border: 1px solid; } .wrapper:before { position: absolute; content: ''; bottom: 0px; left: 0px; height: 15%; width: 100%; background: linear-gradient(to right, transparent 2%, #444, transparent 98%); } .wrapper:after { position: absolute; content: ''; bottom: -186%; left: -50%; height: 200%; width: 200%; border-radius: 50%; background: white; } * { box-sizing: border-box; } .wrapper { transition: all 1s; } .wrapper:hover { height: 300px; width: 400px; }
<div class='wrapper'> <div class='content'></div> </div>
Harry source share