The problem: child backgrounds escaping a rounded parent
A background applied to an element inside a card does not respect the card's border-radius; it bleeds out past the curved corner. The usual fix is overflow: hidden on the card, but that clips everything, not just the paint. Any content positioned outside the card's bounds — via negative margins or position: absolute — gets cut off too.
The alternative: repeat the radius on the child
A more laborious but less invasive fix is to give the child the same border-radius as its parent. Rather than writing the values twice, let the child inherit them:
.child {
border-radius: inherit;
}
If you don't want the full shorthand, corners can be inherited individually:
.child {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
}
The equivalent with logical properties applies start in place of top and left, and end in place of bottom and right:
.child {
border-start-start-radius: inherit;
border-top-end-radius: inherit;
border-end-start-radius: inherit;
border-end-end-radius: inherit;
}
Why not just put the background on the card?
Putting the background directly on the .card that carries the border-radius produces the same visual result — when it's an option. It isn't always: a card split into two halves where only one is colored, for instance, rules it out.
Trade-offs
Inheriting the radius avoids creating future layout problems, which is largely a matter of peace of mind. The pattern should matter more as CSS Anchor Positioning reaches full support; the expectation is that anchor-based popover positioning becomes the norm within roughly one to two years.
For popovers specifically, another approach is preferred: move the popover content out of the document flow and make it a direct child of <body>. That keeps overflow: hidden on ancestors from clipping the popover when anchor positioning is in use.



