html - 我可以在开始标签内包含 IE 条件注释吗?

标签 html internet-explorer conditional-comments

基本上,我想知道这段代码是否可以,

<body id="some_id" <!--[if lt IE 7 ]>class="ie6"<![endif]--> >
</body>

最佳答案

没有。 HTML 注释不能在标签内。尝试:

<!--[if gte IE 7]>--> <body id="some_id"> <!--<![endif]-->
<!--[if lt IE 7]> <body id="some_id" class="ie6"> <![endif]-->

关于html - 我可以在开始标签内包含 IE 条件注释吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3531871/

相关文章:

html - 定义字符集有什么影响?

html - 简单的菜鸟 HTML

asp.net - 不可见的 FileUpload 控件导致 IE 中的 javascript 回发错误

internet-explorer - IE 11 上的“仿真”选项卡中没有任何内容

html - IE9 圆 Angular 和 CSS 背景渐变共存?

html - 使用两个条件 css if 语句不使用任何样式表

javascript & html - 每次用户在文本框中输入项目时创建新的复选框选项

javascript - 我可以让内容出现在 Div 中吗?当光标悬停在单独的 Div 上时?

IE8 的 JQuery 问题 : Expected identifier

css - 取决于操作系统的条件 CSS