HTML/条件注释 - 条件注释在浏览器中的行为是否符合预期?
条件注释在浏览器中的表现是否符合预期?它们会导致渲染错误或其他问题吗?
此 CC 的格式/语法是否有任何错误?
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="718" height="227" id="swf">
<param name="movie" value="images/swf.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="images/swf.swf" width="718" height="227">
<!--<![endif]-->
<img src="images/alt.jpg" border="0" width="718" height="227">
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
Do conditional comments behave as expected across browsers? Can they cause rendering bugs or other issues?
Are there any errors in the formatting/syntax of this CC?
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="718" height="227" id="swf">
<param name="movie" value="images/swf.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="images/swf.swf" width="718" height="227">
<!--<![endif]-->
<img src="images/alt.jpg" border="0" width="718" height="227">
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
条件 CSS 注释特定于 Windows 上的 IE。看看维基百科怎么说。
如果使用正确,它们将在其他浏览器中被解释为常规注释。这实际上取决于您如何使用它们。
您发布的示例将无法正常工作,因为您应该将整个条件包含在 HTML 注释中。
错误:
正确:
Conditional CSS comments are specific to IE on windows. See what wikipedia has to say.
If used correctly, they will be interpreted as regular comments in other browsers. It really depends on how you are using them.
The example you posted will not work correctly, as you are supposed to wrap the whole conditionals in an HTML comment.
Wrong:
Right:
条件注释只是 HTML 注释,它们不会影响其他浏览器,因为它们被视为原样。只有 IE 会识别条件注释。
Conditional comments are just HTML comments, they cannot affect other browsers because they are treated as what they are. Only IE will recognize a conditional comment.
条件注释在浏览器中的表现是否符合预期?
根据我的经验,是的。 (仅如其他人所说的 IE)
它们会导致渲染错误或其他问题吗?
不,不是评论本身。其中的代码可能会导致渲染错误或其他问题,但在某种程度上,任何代码都可能导致渲染错误或其他问题。
此 CC 的格式/语法是否有任何错误?
我看不到,最简单的方法就是测试它。
Do conditional comments behave as expected across browsers?
From my experience, yes. (IE only as others have said)
Can they cause rendering bugs or other issues?
No, not the comments themselves. The code within, possibly, but to the same extent any code can cause rendering bugs or other issues.
Are there any errors in the formatting/syntax of this CC?
Not that I can see, easiest way is to test it.