super-fool / blog

珍藏经典, 分享思想, 共同进步.加油
3 stars 0 forks source link

html条件判断浏览器版本 #20

Open super-fool opened 5 years ago

super-fool commented 5 years ago
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <!-- if IE -->
  <h1>hello, I'm IE!</h1>
  <!-- ![endif] -->

  <!-- if !IE -->
  <h1>hello,i'm not IE!</h1>
  <!-- ![endif] -->

  <!-- if lt IE 10 -->
  <h1>less than IE 10</h1>
  <!-- ![endif] -->

  <!-- if lte IE 10 -->
  <h1>less than or equal IE 10</h1>
  <!-- ![endif] -->

  <!-- if gt IE 10 -->
  <h1>greater than IE 10</h1>
  <!-- ![endif] -->

  <!-- if gte IE 10 -->
  <h1>greater than or equal IE 10</h1>
  <!-- ![endif] -->

  <!-- if (IE 6) | (IE 7) -->
  <h1>just IE6 or IE7</h1>
  <!-- ![endif] -->

  <!-- if (gt IE 5) & (lt IE 7) -->
  <h1> greater than IE5 and less than IE7</h1>
  <!-- ![endif] -->
</body>
</html>