CSS 支持 IE 中的“border-radius”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/635851/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Support for "border-radius" in IE
提问by Tony the Pony
Does anyone know if/when Internet Explorer will support the "border-radius" CSS attribute?
有谁知道 Internet Explorer 是否/何时将支持“border-radius”CSS 属性?
回答by Kevin Florida
Yes! When IE9 is released in Jan 2011.
是的!当 IE9 于 2011 年 1 月发布时。
Let's say you want an even 15px on all four sides:
假设您希望在所有四个边上均等为 15px:
.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.
IE9 将使用默认值border-radius
,因此只需确保将其包含在所有调用边框半径的样式中。然后您的网站就可以为 IE9 做好准备了。
-moz-border-radius
is for Firefox, -webkit-border-radius
is for Safari and Chrome.
-moz-border-radius
适用于 Firefox,-webkit-border-radius
适用于 Safari 和 Chrome。
Furthermore: don't forget to declare your IE coding is ie9:
此外:不要忘记声明您的 IE 编码是 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.
一些懒惰的开发人员有<meta http-equiv="X-UA-Compatible" content="IE=7" />
. 如果该标签存在,则 border-radius 将永远不会在 IE 中工作。
回答by David Johnstone
The answer to this question has changed since it was asked a year ago. (This question is currently one of the top results for Googling "border-radius ie".)
自从一年前提出这个问题以来,这个问题的答案已经发生了变化。(这个问题目前是谷歌搜索“border-radius ie”的最佳结果之一。)
IE9 will support border-radius
.
IE9 将支持border-radius
.
There is a platform preview availablewhich supportsborder-radius
. You will need Windows Vista or Windows 7 to run the preview (and IE9 when it is released).
有一个平台预览可用,它支持border-radius
. 您将需要 Windows Vista 或 Windows 7 才能运行预览(以及 IE9 发布时)。
回答by Luis Melgratti
While you're waiting.. Curved corner (border-radius) cross browser
当你在等待时..弯角(border-radius)跨浏览器
回答by Peter G
A workaround and a handy tool:
一个解决方法和一个方便的工具:
CSS3Pieuses .htc files and the behavior property to implement CSS3 into IE 6 - 8.
CSS3Pie使用 .htc 文件和行为属性在 IE 6 - 8 中实现 CSS3。
Modernizris a bit of javascript that will put classes on your html element, allowing you to serve different style definitions to different browsers based on their capabilities.
Modernizr是一种 javascript,它将在您的 html 元素上放置类,允许您根据浏览器的功能为不同的浏览器提供不同的样式定义。
Obviously, these both add more overhead, but with IE9 due to only run on Vista/7 we might be stuck for quite awhile. As of August 2010 Windows XP still accounts for 48% of web client OSes.
显然,这些都增加了更多的开销,但是由于 IE9 只在 Vista/7 上运行,我们可能会卡住很长一段时间。截至 2010 年 8 月,Windows XP 仍占 Web 客户端操作系统的 48%。
回答by Ben S
It is not planned for IE8. See the CSS Compatibility page.
它不是为 IE8 计划的。请参阅CSS 兼容性页面。
Beyond that no plans have been released. Rumors exist that IE8 will be the lastversion for Windows XP
回答by JAVAC
<!DOCTYPE html>
without this tag border-radius doesn't works in IE9, no need of meta tags.
<!DOCTYPE html>
没有这个标签 border-radius 在 IE9 中不起作用,不需要元标签。
回答by simonrjones
Quick update to this question, IE9 will support border-radius according to: http://blogs.msdn.com/ie/archive/2009/11/18/an-early-look-at-ie9-for-developers.aspx
快速更新这个问题,IE9将根据:http: //blogs.msdn.com/ie/archive/2009/11/18/an-early-look-at-ie9-for-developers.aspx支持border-radius
回答by Iago Bruno
Use -ms-border-radius: 15px
, any element that uses css -ms- is compatible with IE.
使用-ms-border-radius: 15px
,任何使用 css -ms- 的元素都与 IE 兼容。
回答by SigmaBetaTooth
What about support for border radius AND background gradient. Yes IE9 is to support them both seperately but if you mix the two the gradient bleeds out of the rounded corner. Below is a link to a poor example but i have seen it in my own testing as well. Should of taken a screen shot :(
对边界半径和背景渐变的支持怎么样。是的,IE9 将分别支持它们,但是如果将两者混合,则渐变会从圆角中流出。下面是一个糟糕示例的链接,但我也在自己的测试中看到了它。应该截图:(
Maybe the real question is when will IE support CSS standards without MS-FILTER proprietary hacks.
也许真正的问题是 IE 何时会在没有 MS-FILTER 专有黑客的情况下支持 CSS 标准。
http://frugalcoder.us/post/2010/09/15/ie9-corner-plus-gradient-fail.aspx
http://frugalcoder.us/post/2010/09/15/ie9-corner-plus-gradient-fail.aspx
回答by jaya
The corner radius issue of IE gonna solve.
IE的圆角半径问题即将解决。