I want to create an inset border radius for an image using CSS if possible, I am posting this question because all of the solutions I found online so far were for text and using divs.
Here is what I wish to achieve:
Thanks!
I want to create an inset border radius for an image using CSS if possible, I am posting this question because all of the solutions I found online so far were for text and using divs.
Here is what I wish to achieve:
Thanks!
One way:
<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;
}
Demo: http://jsfiddle.net/ofejxfj6/
You can tweak it a little (size of circles/dots and dimensions), but it is pretty close, IMHO.