判断IE版本

<!--[if lte IE 6]>
<![endif]-->
IE6及其以下版本可见

<!--[if lte IE 7]>
<![endif]-->
IE7及其以下版本可见

<!--[if IE 6]>
<![endif]-->
只有IE6版本可见

<![if !IE]>
<![endif]>
除了IE以外的版本

<!--[if lt IE 8]>
<![endif]-->
IE8以下的版本可见


<!--[if gte IE 7]>
<![endif]-->

IE7及大于IE7的版本

 

 

tips:

lte:就是Less than or equal to的简写,也就是小于或等于的意思。
lt :就是Less than的简写,也就是小于的意思。
gte:就是Greater than or equal to的简写,也就是大于或等于的意思。
gt :就是Greater than的简写,也就是大于的意思。
! : 就是不等于的意思,跟javascript里的不等于判断符相同

**********************************菜蛋的分割线*******************

刚试了 所有的都是if判断里的css.貌似木有用.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>if判断IE浏览器模式</title>
</head>
<body>

<!–[if lte IE 8]>
	<style type="text/css">
	body{
		background-color:#3C9;
		}
	</style>
<![endif]–>
<style type="text/css">
body{
background-color:#000;
}
</style>
</body>
</html>


 

在IE试了好几遍结果都一样。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章