判斷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試了好幾遍結果都一樣。。。

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