Corner Frame

Four L-shaped corner brackets appear on hover/focus, framing the image like crop marks.

Corner Frame demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.corner-frame{
  position: relative;
  display: block;
}
.hover-effect.corner-frame::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background:
    linear-gradient(to right,  #111 100%, transparent 100%) top    left  / 36px 3px no-repeat,
    linear-gradient(to bottom, #111 100%, transparent 100%) top    left  / 3px 36px no-repeat,
    linear-gradient(to left,   #111 100%, transparent 100%) top    right / 36px 3px no-repeat,
    linear-gradient(to bottom, #111 100%, transparent 100%) top    right / 3px 36px no-repeat,
    linear-gradient(to right,  #111 100%, transparent 100%) bottom left  / 36px 3px no-repeat,
    linear-gradient(to top,    #111 100%, transparent 100%) bottom left  / 3px 36px no-repeat,
    linear-gradient(to left,   #111 100%, transparent 100%) bottom right / 36px 3px no-repeat,
    linear-gradient(to top,    #111 100%, transparent 100%) bottom right / 3px 36px no-repeat;
}
.hover-effect.corner-frame:hover::before,
.hover-effect.corner-frame:focus-visible::before{
  opacity: 1;
}

The ::before uses eight linear gradients to draw four L-shaped corner brackets that fade in on hover/focus. Select the code and copy with Ctrl+C or ⌘C.