January 2026
Create a Dynamically Sized Image Border in CSS
I'm using container queries to do a basic border sizing for my images. It provides a larger border when there's enough size and drops to a smaller one on narrower screens. I tried playing around with clamp. It never quite worked at both ends of the spectrum.
Output
HTML
CSS
}
}
@) }
}
end of line
Endnotes
There's probably a way to get clamp to do what I want. This does what I need for now.