<address id="ttjl9"></address>

      <noframes id="ttjl9"><address id="ttjl9"><nobr id="ttjl9"></nobr></address>
      <form id="ttjl9"></form>
        <em id="ttjl9"><span id="ttjl9"></span></em>
        <address id="ttjl9"></address>

          <noframes id="ttjl9"><form id="ttjl9"></form>

          HTML條件注釋用法詮釋

          2018-5-3    seo達人

          如果您想訂閱本博客內容,每天自動發到您的郵箱中, 請點這里

          HTML條件注釋用法詮釋

          注釋內容以樣式為例,如下:

          1、支持所有IE瀏覽器

          <!--[if IE]>
          <link rel="stylesheet" href="all-ie-only.css" type="text/css"/>
          <![endif]--> 
          
          • 1
          • 2
          • 3

          2、支持非IE瀏覽器

          <!--[if !IE]>
          <link rel="stylesheet" href="not-ie.css" type="text/css"/>
          <![endif]--> 
          
          • 1
          • 2
          • 3

          上面是除了IE瀏覽器外所有瀏覽器都識別這個樣式,另外CSS-TRICKS《How To Create an IE-Only Stylesheet》一文中提供了另一種寫法:

          <!--[if !IE]><!--> <link rel="stylesheet" type="text/css" href="not-ie.css" /> <!--<![endif]--> 
          
          • 1
          • 2
          • 3

          3、僅僅支持IE10

          <!--[if IE 10]>
          <link rel="stylesheet" type="text/css" href="ie10.css">
          <![endif]--> 
          
          • 1
          • 2
          • 3

          4、支持IE10以下版本(IE9以及IE9以下版本)

          這種方法是樣式表使用在低于IE10的瀏覽器,換句話說除了IE10以外的所有IE版本都將被支持。

          <!--[if lt IE 10]>
          <link rel="stylesheet" type="text/css" href="ie9-and-down.css">
          <![endif]--> 
          
          • 1
          • 2
          • 3

          也可以寫成

          <!--[if lte IE 9]>
          <link rel="stylesheet" type="text/css" href="ie9-and-down.css">
          <![endif]--> 
          
          • 1
          • 2
          • 3

          前面我們也說過了lt和lte的區別,lt表示小于版本號,不包括條件版本號本身;而lte是小于或等于版本號,包括了版本號自身

          上面這幾種方法,使用的是低于(lt)和低于或等于(lte)的方法來判斷,我們也可以使用大于gt和大于或等于gte達到上面的效果:

          5、高于IE9的版本(IE10以及IE10以上版本)

          <!--[if gt IE 9]>
          <link rel="stylesheet" type="text/css" href="ie10-and-up.css">
          <![endif]--> 
          
          • 1
          • 2
          • 3

          <!--[if gte IE 10]>
          <link rel="stylesheet" type="text/css" href="ie10-and-up.css">
          <![endif]--> 
          
          • 1
          • 2
          • 3

          6、指定多種IE版本

          <!--[if (IE 6)|(IE 7)|(IE 8)]>
          <link rel="stylesheet" type="text/css" href="ie6-7-8.css">
          <![endif]--> 
          
          • 1
          • 2
          • 3

          藍藍設計www.syprn.cn )是一家專注而深入的界面設計公司,為期望卓越的國內外企業提供卓越的UI界面設計、BS界面設計 、 cs界面設計 、 ipad界面設計 、 包裝設計 、 圖標定制 、 用戶體驗 、交互設計、 網站建設 、平面設計服務




          日歷

          鏈接

          個人資料

          藍藍設計的小編 http://www.syprn.cn

          存檔

          亚洲va欧美va天堂v国产综合