Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Image Circle Inner Shadow

How can I add an inner shadow to a bootstrap "image-circle"?

jsfiddle

This doesn't work..

.box-shad {
  box-shadow: 0 10px 20px #777 inset, 0 0 200px #000 inset, 0 0 150px #000 inset, 0 0 100px #000 inset;
}
<img class="img-circle box-shad" alt="" src="http://placehold.it/140x140"><img class="img-circle box-shad" alt="" src="http://placehold.it/140x140">

Thanks for any ideas.


SOLUTION:

Put the box shadow on a circular div with background image set to the image, rather than using an image.

like image 549
Nick B Avatar asked Feb 13 '26 09:02

Nick B


1 Answers

This works to me. Please try it.

.inner-shadow {
  box-shadow: inset 3px 3px 4px black;
  border-radius: 50%;
}
img {
  width: 100%;
  border-radius: 50%;
  position: relative;
  z-index: -10;
}		
<div class="inner-shadow">
	<img src="http://placehold.it/300x300" alt="">
</div>
like image 87
wataru Avatar answered Feb 16 '26 20:02

wataru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!