Support for border-radius in IE
Yes! When IE9 is released in Jan 2011.
Let's say you want an even 15px on all four sides:
.myclass {
border-style: solid;
border-width: 2px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}
IE9 will use the default border-radius
, so just make sure you include that in all your styles calling a border radius. Then your site will be ready for IE9.
-moz-border-radius
is for Firefox, -webkit-border-radius
is for Safari and Chrome.
Furthermore: don't forget to declare your IE coding is ie9:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
Some lazy developers have <meta http-equiv="X-UA-Compatible" content="IE=7" />
. If that tag exists, border-radius will never work in IE.
ie9 border radius
Have you got this at the top of your HTML document (Above the <html>
tag)
<!DOCTYPE html>
IE9 requires this for the website to display the new HTML5 / CSS3 things
Edit: Or many other Doctype's (XHTML etc, but this is the shortest and easiest to remember)
IE9 border-radius
Looks like the page is firing Quirks Mode, try moving those script & css includes down inside the tag... nothing should ever come between a doctype and it's html tag.
Detail explanation here Investigating Document Mode Issues
Which border radius property will work in IE9?
IE9 will support border-radius
see: http://ie.microsoft.com/testdrive/HTML5/01BorderRadius/Default.html
Border Radius Not WORKING in IE9
.myclass {
border-style: solid;
border-width: 2px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}
IE9 will use the default border-radius, so just make sure you include that in all your styles calling a border radius. Then your site will be ready for IE9.
-moz-border-radius is for Firefox, -webkit-border-radius is for Safari and Chrome.
Furthermore: don't forget to declare your IE coding is ie9:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
Some lazy developers have <meta http-equiv="X-UA-Compatible" content="IE=7" />
. If that tag exists, border-radius will never work in IE.
ie9 border radius css
Add this to your markup as the very first line.
<meta http-equiv="X-UA-Compatible" content="IE=9" />
Use this for border radius for better compatibility with other browsers also.
-moz-border-right-radius: 5px;
-webkit-border-right-radius: 5px;
border-right-radius: 5px;
-moz-border-left-radius: 5px;
-webkit-border-left-radius: 5px;
border-left-radius: 5px;
CSS3 Border-Radius and IE9
It has nothing to do with your SVG image or its data URI, but it has to do with your filter
. Effects generated by the filter
property, which you're using, do not get clipped by border-radius
, and often overlap certain other things such as background images.
Whether this is a real bug or an unintended side effect, I don't know, but that's the cause in IE9, as it doesn't implement CSS3 gradients — only IE10 does.
Since you're using an SVG image anyway, you can easily fall back to that instead of using filter
.
IE9 border-radius and background gradient bleeding
Here's one solution that adds a background gradient, using a data URI to create a semi-transparent image that overlays any background color. I've verified that it's clipped correctly to the border radius in IE9. This is lighter weight than SVG-based proposals but as a downside, is not resolution-independent. Another advantage: works with your current HTML/CSS and does not require wrapping with additional elements.
I grabbed a random 20x20 gradient PNG via a web search, and converted it into a data URI using an online tool. The resulting data URI is smaller than the CSS code for all that SVG mess, much less the SVG itself! (You could apply this conditionally to IE9 only using conditional styles, browser-specific css classes, etc.) Of course, generating a PNG works great for button-sized gradients, but not page-sized gradients!
HTML:
<span class="button">This is a button</span>
CSS:
span.button {
padding: 5px 10px;
border-radius: 10px;
background-color: orange;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAvUlEQVQ4y63VMQrDMAyF4d/BGJ+rhA4dOnTo0Kn3P4ExxnSoXVQhpx0kEMmSjyfiKAF4AhVoqrvqjXdtoqPoBMQAPAZwhMpaYkAKwH1gFtgG0v9IlyZ4E2BVabtKeZhuglegKKyqsWXFVboJXgZQfqSUCZOFATkAZwEVY/ymQAtKQJ4Jd4VZqARnuqyxmXAfiAQtFJEuG9dPwtMC0zD6YXH/ldAddB/Z/aW4Hxv3g+3+6bkvB/f15b5gXX8BL0z+tEEtuNA8AAAAAElFTkSuQmCC);
background-size: 100% 100%;
border: 2px solid white;
color: white;
}
Related Topics
Why Anchor Tag Does Not Take Height and Width of Its Containing Element
Using CSS :Before and :After Pseudo-Elements With Inline Css
Chrome Download Attribute Not Working
How to *Really* Justify a Horizontal Menu in Html+Css
Apply Style to Parent If It Has Child With Css
Difference Between Width:100% and Width:100Vw
Can You Have Multiline HTML5 Placeholder Text in a <Textarea>
What Elements Can Be Contained Within a <A> Tag
Hiding Elements in Responsive Layout
Setting the Character Encoding in Form Submit For Internet Explorer
Displaying Unicode Symbols in Html
Ng-App Vs. Data-Ng-App, What Is the Difference
CSS Background Image Alt Attribute
How to Determine Height of Content-Box of a Block and Inline Element