HTML中的IF IE条件控制语句

因为浏览器的不同,经常要用到CSS中的HACK来区别而达到相同的目的。其实有时不一定就要用CSS啲,用HTML中的IF也能完成。

首先必须要将其写入注释格式<!-- -->中,然后......

<!--[if !IE]>除IE外都可识别<![endif]-->

<!--[if IE]> 所有的IE可识别 <![endif]-->

<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->

<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->

<!--[if gt IE 5.0]> IE5.0以及IE5.0以上版本都可以识别 <![endif]-->

<!--[if IE 6]> 仅IE6可识别 <![endif]-->

<!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]-->

<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->

<!--[if IE 7]> 仅IE7可识别 <![endif]-->

<!--[if lt IE 7]> IE7以及IE7以下版本可识别 <![endif]-->

<!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]-->

posted @ 2012-12-20 11:22  翱翔软件  阅读(2902)  评论(0)    收藏  举报

欢迎访问翱翔软件