其他浏览器是否实施了条件注释? [英] have other browsers implemented conditional comments?

查看:43
本文介绍了其他浏览器是否实施了条件注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IE允许您根据他们的浏览器的注释条件来检测运行哪个版本的IE(我实际上不知道这是否是他们所说的名称,有人可以纠正我的身份).

IE allows you to do detect which version of IE is running based on their browsers comment conditions (I actually don't know if that is what they are called, someone can correct me if it is not).

<! --[if lt IE 7]> css code here.. <! [endif] -->

有人知道其他浏览器是否已经按照他们的示例来确定正在使用哪个版本的浏览器吗?

Does anyone know if other browsers have followed their example to determine what version of thier browser is being used?

<! --[if FF]> css code here.. <! [endif] -->
<! --[if O]> css code here.. <! [endif] -->

推荐答案

通常,您不需要在现代浏览器(FF3.6,Chrome,IE9,Safari)中执行此操作.另外,如果将黑客定位为仍在变化的浏览器,则冒着黑客仍然可以运行的风险,但是解决了该问题,但已解决,然后修复失败.

In general, you shouldn't need to do this with modern browsers (FF3.6, Chrome, IE9, Safari). Also, if you target a hack at a browser that is still changing, you run the risk of the hack still working but the problem it solved being fixed, and then your fix breaks.

乱码或条件注释仅应针对旧浏览器(IE6和IE7是主要目标).

Hacks or conditional comments should only be aimed at old browsers (IE6 and IE7 are the main targets).

这篇关于其他浏览器是否实施了条件注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆