Html 边框半径在 IE9 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10784999/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 00:40:57  来源:igfitidea点击:

Border Radius Not WORKING in IE9

htmlcss

提问by Shivayan

Border Radius is not working in IE9. The following Attribute i used in my project. and also i add the .HTC file also

Border Radius 在 IE9 中不起作用。我在我的项目中使用了以下属性。我还添加了 .HTC 文件

-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
behavior: url(Styles/border-radius.htc); 

回答by Gaurav Agrawal

.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 将使用默认的边框半径,因此只需确保将其包含在所有调用边框半径的样式中。然后您的网站就可以为 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:

此外:不要忘记声明您的 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 Ballu Rocks

Use

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 

回答by Ags1

This is an old thread, but it did not help me. My solution was to add the HTML 5 doctype declaration to the page:

这是一个旧线程,但它没有帮助我。我的解决方案是将 HTML 5 doctype 声明添加到页面:

<!DOCTYPE html>

<!DOCTYPE html>

Other HTML doctype declarations may work too - my problem was I was generating the pages with no doctype declaration at all.

其他 HTML doctype 声明也可能有效 - 我的问题是我生成的页面根本没有 doctype 声明。

回答by dockeryZ

You need to put this in your HTML header

你需要把它放在你的 HTML 标题中

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Answer discovered here ie9 border radius

答案在这里发现ie9 边界半径

回答by Vladimir Starkov

border-radius.htcbroke normal border-radius in ie9, include border-radius.htc file in ie versions below 9 with conditional comments

border-radius.htc打破了 ie9 中的正常边界半径,在 9 岁以下的 ie 版本中包含 border-radius.htc 文件 conditional comments

回答by mborecki

in IE9 border-radius works without any behavior files.

在 IE9 中,border-radius 无需任何行为文件即可工作。

回答by Undefined

This answer will also help with lower versions of ie, like ie6,7,8.

这个答案也将有助于较低版本的 ie,如 ie6、7、8。

Using CSS Pie -> http://css3pie.com/

使用 CSS Pie -> http://css3pie.com/

This will allow you to specify your border radius normally and then include the pie.htc script in your css. This magically make it work in IE6. Look at that!

这将允许您正常指定边框半径,然后在您的 css 中包含 pie.htc 脚本。这神奇地使它在 IE6 中工作。看那个!

This also works with other CSS3 properties like background gradients.

这也适用于其他 CSS3 属性,如背景渐变。

You can also try adding this to your head ->

您也可以尝试将其添加到您的头脑中 ->

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Good luck!

祝你好运!

回答by CSS Guy

border radius supported ie-7, ie-8, ie-9 via javascript check this tutorial how to show border radius in ie http://davidwalsh.name/css-rounded-corners

边框半径支持 ie-7、ie-8、ie-9 通过 javascript 检查本教程如何在 ie http://davidwalsh.name/css-rounded-corners 中显示边框半径

回答by belkin

If you use at the same time border-radius with filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='######', endColorstr='######',GradientType=0 ), just comment this filter.

如果您同时使用 border-radius 和过滤器: progid:DXImageTransform.Microsoft.gradient( startColorstr='######', endColorstr='######',GradientType=0 ),只需注释这个过滤器。

回答by Shivayan

No matter what you include or what you write border-radius doesn't work in ie9. Changing the browser mode or document mode is never a solution because that it is on the client side. So i am afraid my friend there is no plausible way to make border-radius work properly in ie9 unless you take the help of javascript.

无论您包含什么内容或您编写什么内容,border-radius 在 ie9 中都不起作用。更改浏览器模式或文档模式从来都不是解决方案,因为它在客户端。所以我担心我的朋友没有合理的方法可以使 ie9 中的 border-radius 正常工作,除非您借助 javascript。