<img src="https://picsum.photos/id/1069/200/200" >
img {
--color: #FA6900; /* the color of the border */
--border: 10px; /* the thickness of the border */
--offset: 30px; /* control the movement of the border */
--gap: 5px; /* the gap on hover */
border-radius: 50%;
cursor: pointer;
padding: calc(var(--border) + var(--gap));
border: var(--offset) solid #0000;
--_g: #0000 calc(99% - var(--border)), var(--color) calc(100% - var(--border)) 99%,#0000;
--_s: calc(var(--offset) - var(--border));
--_r: 100% 100% at;
background:
radial-gradient(50% 50%, #0000 calc(100% - var(--offset)),red calc(100% - var(--border))) border-box,
radial-gradient(var(--_r) 0 0 ,var(--_g)) calc(100% + var(--_s)) calc(100% + var(--_s))/50% 50%,
radial-gradient(var(--_r) 100% 0 ,var(--_g)) calc(0% - var(--_s)) calc(100% + var(--_s))/50% 50%,
radial-gradient(var(--_r) 0 100%,var(--_g)) calc(100% + var(--_s)) calc(0% - var(--_s))/50% 50%,
radial-gradient(var(--_r) 100% 100%,var(--_g)) calc(0% - var(--_s)) calc(0% - var(--_s))/50% 50%;
background-repeat: no-repeat;
transition: .4s;
outline:1px solid;
}
img:hover {
--_s: 0px
}
body {
margin:0;
background:#ccc;
display:grid;
min-height:100vh;
grid-auto-flow:column;
place-content:center;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.