文本只出现在具有条件语句的IE上

时间:2016-05-18 14:52:01

标签: internet-explorer conditional

很抱歉,如果在其他地方发布了类似的问题,我一直在搜索每个地方,我仍然无法找到解决问题的正确方法。

我在这里要完成的是在我网站的顶部标题框中为 IE 11 上的用户 ONLY!显示一行文字。 so to the left of those two buttons a sentence should only appear for IE 11 users to be able to read, all else are in the clear.

已经给出了解决方案,目前在我的代码中有<!--[if IE 11]> <p> only IE 11 will see this </p> <![endif]-->

在我打开元素时,我的网站上没有显示任何内容。

<!--[if !(IE)]><!--> i am not ie <!--<![endif]-->

第二个在所有浏览器上显示它,这是我不想完成的。

提前感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

条件评论仅适用in IE 9 and below。如果要向IE 11用户显示消息,可能需要使用JavaScript来显示它。