Html 如何在 IE8 中使用 CSS 制作圆角边框?

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

How to make rounded border in IE8 with CSS?

htmlcss

提问by kst

I would like to know how to make rounded border in IE8. I'm using

我想知道如何在 IE8 中制作圆角边框。我正在使用

-moz-border-radius:4px;
-webkit-border-radius:4px;

for mozilla and safari.

对于 mozilla 和 safari。

采纳答案by Matt Ball

There's a jQuery plugin for that. http://jquery.malsup.com/corner/

有一个 jQuery 插件。http://jquery.malsup.com/corner/

回答by zdesam

Download https://code.google.com/p/curved-corner/and include in your project. Then use the following css to have rounded corner.

下载https://code.google.com/p/curved-corner/并包含在您的项目中。然后使用以下css来圆角。

For example:

例如:

.somediv{
   -webkit-border-radius:4px;        /* older webkit based browsers */
   -khtml-border-radius:4px;         /* older khtml based browsers */
   -moz-border-radius:4px;           /* older firefox */
   border-radius:4px;                /* standard */
   behavior: url(border-radius.htc); /* IE 6-8 */
}

The url to the file is relative to the HTML file which loads the CSS. So this is different to background: url(...) behavior which is relative to the CSS file. More details here

文件的 url 与加载 CSS 的 HTML 文件相关。所以这与 background: url(...) 行为不同,它是相对于 CSS 文件的。更多细节在这里

回答by Rob

You can't. IE doesn''t handle modern standards and practices and, specifically, no such CSS property exists in IE8.

你不能。IE 不处理现代标准和实践,特别是 IE8 中不存在这样的 CSS 属性。

回答by Moshe

In IE9 you can use border-radius.

在 IE9 中,您可以使用边界半径。

For the older IE versions, there are javascript libraries that will do it for you. You can't do it purely with CSS. At the very least you will need background images.

对于较旧的 IE 版本,有一些 javascript 库可以为您完成。你不能纯粹用 CSS 来做到这一点。至少你需要背景图片。

回答by maikelsabido

You can use CSS3 PIE for this. It's easy to implement. Just download it here: http://css3pie.com/download/and extract its contents. Then, on your stylesheet, just put behavior:url(css3pie/PIE.htc);along with the css codes of each element that uses border-radius.

您可以为此使用 CSS3 PIE。这很容易实施。只需在此处下载:http: //css3pie.com/download/并提取其内容。然后,在您的样式表上,将behavior:url(css3pie/PIE.htc);每个使用 border-radius 的元素的 css 代码放在一起。

For example:

例如:

.samplediv{
    behavior:url(css3pie/PIE.htc);
    -webkit-border-radius:10px;
    -khtml-border-radius:10px;       
    -moz-border-radius:10px;           
    border-radius:10px;               
}