gpt4 book ai didi

javascript - 如何使用 CSS 定位 Firefox 和 IE?

转载 作者:行者123 更新时间:2023-11-30 07:14:56 25 4
gpt4 key购买 nike

从 webkit 浏览器到 Firefox 和 Internet Explorer,我的网站布局略有不同。我需要针对 Firefox 和 IE 仅在这两个浏览器中应用一些 CSS。

我试过 Firefox:

@-moz-document url-prefix() {
// CSS here
}

我已经为 IE 尝试了这两种解决方案:

<!--[if IE]><!-->
// Load specific CSS file here
<!--<![endif]-->

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
// CSS here
}

但没有任何作用。我需要用 Javascript 来做吗?如果是这样,为什么我不能像每个人似乎做的那样使用 CSS 或 HTML 来定位它?

最佳答案

似乎对我有用:

// Firefox debug
@-moz-document url-prefix() {
#id {rules: argument;}
...
}

// IE debug
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.class {rules: arg;}
...
}

关于javascript - 如何使用 CSS 定位 Firefox 和 IE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27333745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com