图像的插入边框半径

Inset border-radius for an image

如果可能的话,我想使用 CSS 为图像创建一个插入边框半径,我发布这个问题是因为到目前为止我在网上找到的所有解决方案都是针对文本和使用 div。

这是我希望实现的目标:

谢谢!

一种方式:

<div class="container">
    <div class="dot1"></div>
       <div class="dot2"></div>
      <div class="dot3"></div>
       <div class="dot4"></div>
    <img src='http://placehold.it/400x300'>
</div>

CSS:

.container {
    position:relative;
    margin:50px auto;
    width:400px;
}
.dot1 {
    background-color:white;
    width:50px;
    height:50px;
    border-radius:100%;
    position:absolute;
    left:-25px;
    top:-25px;
}
.dot2 {
    background-color:white;
    width:50px;
    height:50px;
    border-radius:100%;
    position:absolute;
    right:-25px;
    top:-25px;
}
.dot3 {
 background-color:white;
    width:50px;
    height:50px;
    border-radius:100%;
    position:absolute;
    right:-25px;
    bottom:-25px;
}

.dot4 {
 background-color:white;
    width:50px;
    height:50px;
    border-radius:100%;
    position:absolute;
    left:-25px;
    bottom:-25px;
}

演示:http://jsfiddle.net/ofejxfj6/

您可以稍微调整一下(circles/dots 的大小和尺寸),但恕我直言,它非常接近。