Is this a bug with CSS3: Rounded corners with CSS3 gradient


I'm running into an issue where the border of an outer div with rounded-corners is getting cut-off by an inner element with a CSS3 gradiet. Is this a bug with CSS3 - if so, I'll happily submit a bug-report.

If not, how do I fix this?

Source & Demo here:


alt text

Problem courtesy of: doremi


The problem isn't the gradient - give your <h2> element a solid background to see. Instead, you need to round the corners of the <h2> as well as of the wrapping <div>.

Add border-radius: 10px 10px 0 0; and the appropriate vendor-specific versions to the <h2> styling and it all works.

Solution courtesy of: Chowlett


overflow:hidden; does not work

but this does:

Discussion courtesy of: Thorgeir

It's not specific to background gradients. It's just the background of the h2 element overlapping sitting on top of the rounded corners. I'm not sure it's a bug in the strictest sense, but it is fairly well known. Easiest 'fix' is rounding the corners of the element with the background. Example: just setup for chrome

Discussion courtesy of: lnrbob

This recipe can be found in it's original form on Stack Over Flow.