This method requires the image to be wrapped in a div because - and I'm not sure why - in Safari psuedo elements will not be displayed for img elements.
HTML
<div class="box"><img src="http://placehold.it/200x200/" /></div>
CSS
.box { display:inline-block; line-height: 0; } .box, .box:before { border: 8px solid #fff; border-radius: 16px; position: relative; z-index: 1; } .box:before { display: block; content: ''; position: absolute; top: -8px; left: -8px; right: -8px; bottom: -8px; z-index: 2; }
Element :before psuedo sits on top of the image with its inner curved border, basically simulating the inner curved border of the image. This is a pretty nice workaround that allows you a curved inner border.
border-width location of the wrapper and image, and the top , left , right and bottom :before should be two times less than the radius of the border of the wrapper element.
http://jsfiddle.net/nvG5S/
source share