Post

#CSS trick not enough folks know about: painting into the sub boxes of an element - border - padding - content you can paint into one, or all of them differently! here's a gradient border, a solid padding fill, and a gradient content (inner) box see fur yerself codepen.io/argyleink/pe...

29 reposts191 likes

Not to mention that you can even paint _outside_ the box with border-image. Which is great in combination with overflow: hidden/scroll/auto if you want to draw something but not have it clipped. (Incidentally, saw this used in your latest YouTube video for some view transition tricky, @nerdy.dev.)

I swear I googled a gradient border a few months ago and the best answer was a nested div. Where was this solution? Why didn't Google give it to me? I'd like to file a complaint