CSS IE9 边框半径
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7369796/
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
IE9 border-radius
提问by Osman
curved css corners for some reason dont seem to work in IE9. I know it supports it however i have looked all over the web for a solution and cant find one that works for me. I tried putting <meta http-equiv="X-UA-Compatible" content="IE=9" />
but that did'nt work. I used the .htc file and behavior: url(border-radius.htc);
however that only works sometimes when switching to compatibility mode. I even tried declairing all 4 values, and didnt make a diffrence. Work beautifuly in firefox, chrome, and safari but not in IE. Any help? Check it out: my web pageIf you have some debugging tool might help you help me.
出于某种原因,弯曲的 css 角在 IE9 中似乎不起作用。我知道它支持它,但是我在网上到处寻找解决方案,但找不到适合我的解决方案。我试过放置,<meta http-equiv="X-UA-Compatible" content="IE=9" />
但没有用。我使用了 .htc 文件,behavior: url(border-radius.htc);
但是只有在切换到兼容模式时才有效。我什至尝试声明所有 4 个值,并且没有区别。在 firefox、chrome 和 safari 中可以很好地工作,但在 IE 中则不行。有什么帮助吗?检查一下:我的网页如果您有一些调试工具可能会帮助您帮助我。
回答by Grahf
I found if your using the CSS style filter
for IE8 and below browsers it will interfere with IE9 styles causing border-radius
to not work and possible other ill effects.
我发现如果您在filter
IE8 及以下浏览器中使用 CSS 样式,它会干扰 IE9 样式,从而导致border-radius
无法工作和可能的其他不良影响。
To fix it add this to your html head:
要修复它,请将其添加到您的 html 头部:
<!--[if gte IE 9]>
<style type="text/css">.elementClass { filter: none !important; }</style>
<![endif]-->'
回答by albert
Use the vendor extensions, -moz-border-radius:15px; -ms-border-radius:15px; -o-border-radius:15px; -webkit-border-radius:15px; border-radius:15px;
使用供应商扩展, -moz-border-radius:15px; -ms-border-radius:15px; -o-border-radius:15px; -webkit-border-radius:15px; border-radius:15px;
You really only need the -ms
version for what you want, but if you include them all you provide a broader spectrum of coverage.
你真的只需要-ms
你想要的版本,但如果你把它们都包括在内,你就可以提供更广泛的覆盖范围。
回答by seanmetzgar
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.
看起来页面正在触发 Quirks 模式,请尝试将这些脚本和 css 包含在标签内向下移动......在 doctype 和它的 html 标签之间不应该有任何东西。
Detail explanation here Investigating Document Mode Issues
此处的详细说明调查文档模式问题
回答by Finbar Maginn
I found that my border radius in ie9 is working on localhost but not on a server. Im using css3PIE to acomidate ie8 and below, would this be interfering with ie9?
我发现我在 ie9 中的边界半径在本地主机上工作,但不在服务器上。我使用 css3PIE 来支持 ie8 及以下,这会干扰 ie9 吗?
回答by Mohsen
IE9 don't need any prefix for border-radius
(for sure you don't need -ms-
prefix at least for this property!). Your browser probably have a problem. Maybe you're running beta or something like that.
IE9 不需要任何前缀border-radius
(当然你-ms-
至少不需要这个属性的前缀!)。您的浏览器可能有问题。也许你正在运行测试版或类似的东西。
Please test this demoin another IE9 running computer or have your IE restarted and try it to see IE9 renders border-radius
just fine.
请在另一台运行 IE9 的计算机上测试此演示,或者重新启动 IE 并尝试查看 IE9 呈现是否border-radius
正常。
回答by Stephen
Quirks mode is where IE9 switches back to IE5 functionality (added following link to @seanmetzgar post also)
Quirks 模式是 IE9 切换回 IE5 功能的地方(也添加了@seanmetzgar 帖子的链接)
Detail explanation here Investigating Document Mode Issues
此处的详细说明调查文档模式问题
With a site I look after, which had ASP code right at the top of page, I added
有了一个我照顾的网站,它在页面顶部有 ASP 代码,我添加了
<!DOCTYPE html>
just in front of the tag, below the code, and IE9 stopped going into Quirks Mode.
就在标签前面,代码下面,IE9 停止进入怪癖模式。