I have a div that I am applying rounded corners to.
Here is my demo fiddle.
<div> </div>
div {
margin: 20px;
width: 250px;
height: 250px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-khtml-border-radius: 15px;
border-radius: 15px;
background-color: #4c66a1;
border: 2px solid #4c66a1;
}
I also have a border and background color applied to this div. The issue arises in Firefox. There is a small amount of whitespace between the border and the background-color of the div (see images below). It is very minimal, but people have noticed it nonetheless. It looks like a lighting effect on the corner.
Is this a known issue with rounded corners in Firefox? IE, Chrome, and Opera are fine.
FYI/ For the purposes of illustrating the issue I have made the border and background-color the same even though it's redundant. It makes the whitespace stand out more.
Firefox Chrome/IE/Opera
Padding could be added to the container (outer) element to push the element inside away from it's border. Margin could be used on the inner element to push itself away from the container.
If there are contents within the div that has the curved corners, you have to set overflow: hidden because otherwise the child div's overflow can give the impression that the border-radius isn't working.
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.
Interestingly, if we change it to dotted, the white goes away:
div {
margin: 20px;
width: 250px;
height: 250px;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
-khtml-border-radius: 30px;
border-radius: 30px;
background-color: #4c66a1;
border: 2px dotted #4c66a1;
}
http://jsfiddle.net/5yAkZ/23/
EDIT had invalid css previously
See https://bugzilla.mozilla.org/show_bug.cgi?id=704399 which is fixed in Firefox 11 and newer.
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