-moz-border-radius 导致在 IE8 中生成内联样式

发布于 2024-10-15 04:53:12 字数 371 浏览 3 评论 0原文

我通过包含主要浏览器的样式属性向我的网站添加圆角 -

.optional{
    -moz-border-radius: 10px;
    -webkit-border-radius:10px;
    border-radius:10px;
}

但当我在 IE8 中加载它时,浏览器会生成一堆内联样式,所有这些样式都会覆盖我之前定义的样式。我不想向所有这些样式添加 !important 以防止它们被覆盖。

现在,当我删除 -moz-border-radius: 10px; 时,一切正常。我不想测试我没有使用 IE 并加载单独的 CSS 文件。

我在网上找不到任何与此相关的信息。非常感谢帮助。

I am adding rounded corners to my website by including the style attributes for the major browsers -

.optional{
    -moz-border-radius: 10px;
    -webkit-border-radius:10px;
    border-radius:10px;
}

When I load this up in IE8 though, the browser generates a bunch of inline styles, all of them overriding my previously defined styles. I do not want to add !important to all of these styles to keep them from being overridden.

Now, when I delete -moz-border-radius: 10px; everything works fine. I do not want to have to test that I'm not using IE and load a separate CSS file.

I have not been able to find anything online regarding this. Help much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫儰鉨ミ守葔 2024-10-22 04:53:12

IE8 不支持 border-radius 属性。CSS 兼容性-IE8 你必须使用行为属性。您可以在此处找到所需的 .htc 文件和文档:跨浏览器弯角

IE8 does not support border-radius property.CSS compatibility-IE8 You have to use behavior property. You can find the required .htc file and documentation here: cross browser curved corner

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文