影响IE8浏览器的条件代码是什么?

发布于 2024-10-08 20:01:58 字数 161 浏览 0 评论 0原文

我的意思不是嵌入到 html 中的条件注释。我指的是可以直接放入css文件中的条件代码。比如:

*+html .myClass {} is for IE7
* html .myClass {} is for IE 6

IE 8 的是什么?

I don't mean conditional comments embedded into the html. I am refering to the conditional code that can be put directly into the css file. Like:

*+html .myClass {} is for IE7
* html .myClass {} is for IE 6

what is the one for IE 8?

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

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

发布评论

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

评论(3

阳光下慵懒的猫 2024-10-15 20:01:58

你想达到什么目的?您不必为 IE8 修改 CSS。我认为 IE8 没有条件代码,因此如果您绝对需要 IE8 的样式表,您可能必须转向条件注释。

<!--[if IE 8]>
    <link href="ie8css.css" rel="stylesheet" type="text/css" />
<![endif]-->

What are you trying to achieve? You shouldn't have to hack up your CSS for IE8. I don't think there is a conditional code for IE8 so if you absolutely need to have a style sheet for IE8, you might have to turn to conditional comment.

<!--[if IE 8]>
    <link href="ie8css.css" rel="stylesheet" type="text/css" />
<![endif]-->
开始看清了 2024-10-15 20:01:58

HTML 标记的条件注释,允许您在 CSS 中定位 .ie8:

<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->

这就是 html5boilerplate

另外,请注意 Paul 的博客文章<的最后几段< /a>.我同意你应该尝试在不针对特定浏览器的情况下使其工作,这是可能的。

Conditional comment for the HTML tag, which will allow you to target .ie8 in your CSS:

<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->

That is what's currently being used in html5boilerplate.

Also, be weary of the last few paragraphs in Paul's blog post. I agree that you should try to make it work without targeting specific browsers, it at all possible.

深海夜未眠 2024-10-15 20:01:58

根据此网站,您可以执行以下操作:

.selector {
    property: value\0/;
}

此黑客攻击有几个类似的变体,但这是最简单的。这很容易记住。只需在 CSS 规则末尾添加 \0/ 即可。

According to this site, you can do the following:

.selector {
    property: value\0/;
}

There are several similar variants of this hack, but this is the easiest. It’s very easy to remember. Just add the \0/ at the end of a CSS rule.

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