我知道已经有很多关于在IE8中获取圆角的文章。我的问题是,如何使用现代来支持CSS3/HTML5特性?
例如,为了在IE8中显示圆角,我使用CSS-3属性
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;我已经在我的页面中包含了IE8,但是仍然不能在页面中看到圆角。
发布于 2012-11-08 20:45:40
Modernizr不启用功能,它只是测试它们是否可用。对于CSS,它还可以消除使用特定于供应商的属性的需要,例如-moz-*和-webkit-*,允许您简单地使用标准属性:
.myElement {
-webkit-border-radius: 20px; /* No need for this */
-moz-border-radius: 20px; /* No need for this */
border-radius: 20px;
}对于IE8中的圆角,我不会费心使用现代特征检测,只需使用CSS PIE来启用它们。
.myElement {
border-radius: 8px;
behavior: url(/PIE.htc); /* only IE will use this */
}请务必阅读the docs,了解如何让它工作。
顺便说一句,现在mozilla和webkit浏览器支持标准border-radius已经有很长一段时间了,你可能想看看你的目标浏览器是否真的需要这些前缀:http://caniuse.com/#search=border-radius (点击“显示所有版本”)
https://stackoverflow.com/questions/13289309
复制相似问题