I found a great CSS tutorial on how to style borders with images. The tutorial can be found here. The example result of following the tutorial looks like this: https://i.sstatic.net/pgJhM.png
One interesting thing I learned from the tutorial is using background-clip: padding-box;
to prevent the background from showing through the border image. Now I'm curious if it's possible to clip the background only halfway through the border to achieve a similar look as in this edited paint illustration: https://i.sstatic.net/1dmg0.png
Just to clarify, I do not want the result where the background-clip declaration is removed completely: https://i.sstatic.net/uo0Ft.png
UPDATE:
I came across the property border-image-outset
, which seems promising, but unfortunately setting it to a negative value doesn't work.
LATEST UPDATE:
Any solutions provided should consider cases where dimensions are unknown, such as when the width
property is set as a percentage.