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: http://jsfiddle.net/joshuamcginnis/2aJ8X/
Screenshot:
The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners.
With the CSS border-radius property, you can give any element "rounded corners".
CSS3 Rounded corners are used to add special colored corner to body or text by using the border-radius property.A simple syntax of rounded corners is as follows − #rcorners7 { border-radius: 60px/15px; background: #FF0000; padding: 20px; width: 200px; height: 150px; }
You can give any element “rounded corners” by applying a border-radius through CSS. You'll only notice if there is a color change involved. For instance, if the element has a background-color or border that is different than the element it's above.
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.
overflow:hidden; does not work
but this does:
h2
{
position:relative;
z-index:-1;
....
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With