Skip to content

Note

不挑戰記憶力的技術筆記

Menu
Menu

[HTML]判斷IE version

Posted on 2012 年 2 月 23 日 by febr

[html]
<!–[if IE]>
只有IE看的到,其他瀏覽器看不到
<![endif]–>

<!–[if IE 6]>
只有IE6 看的到,其他瀏覽器看不到
<![endif]–>

<!–[if lt IE 7]>
比IE7舊才看的到(不包含IE7),其他瀏覽器看不到
<![endif]–>

<!–[if gte IE 8]>
IE8版本以上才看的到(包含IE8),其他瀏覽器看不到
<![endif]–>

<!–[if !IE]>–>
不是IE的才看的到
<!–<![endif]–>

<!–[if !(IE 6)]>
除了IE6以外都看的到,其他瀏覽器看不到
<![endif]–>

<!–[if (gte IE 6)&#038;(lt IE 8)]>
IE6以上且低於IE8的版本才看的到,其他瀏覽器看不到
<![endif]–>

<!–[if (IE 7)|(IE 6)]>
只有IE7 或 IE6 看的到,其他版本及其他瀏覽器看不到
<![endif]–>

<!–[if gte IE 7]><!–>
內容在 IE7 及比較新的版本,以及 IE 以外的瀏覽器都看的到。
<!–<![endif]–>
[/html]

可用語法:

if 判斷yes or no
lt less-than(<),例如 [if lt IE 7]: 版本小於IE7,不包含IE7。
lte less-than or equal(<=),例如 [if lte IE 7]: 版本小於IE7,包含IE7。
gt greater-than(>),例如 [if gt IE 7]: 版本大於IE7,不包含IE7。
gte greater-than or equal(>=),例如 [if gte IE 7]: 版本大於IE7,包含IE7。
! NOT,例如[if !IE]:不是IE的。
& AND,例如[if (gt IE 7)&(lt IE 9)]:要大於IE7且小於IE9(=IE8的意思)
| OR,例如[if (IE 6)|(IE 7)]:IE6或IE7都會符合條件。

發佈留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

近期文章

  • [AWS] S3 Object Initiate restore (復原回 Standard)
  • [Windows] 使用者快速登出的方法 Logout/ Logoff/Sign Out from Windows User Account
  • [Windows] Windows 11 安裝Server管理工具Install RSAT(Remote Server Administrator Tools)
  • Chrome出現:你的連線不是私人連線 Your connection is not private
  • [C#] 取得 Request URL 的方法

近期留言

    彙整

    分類

    • Ajax
    • Android
    • ASP
    • ASP.NET MVC
    • Azure
    • C#
    • Cisco
    • CSS
    • Delphi
    • Developer Tools
    • Framework
    • FreeBSD
    • Git
    • HTML5
    • javascript
    • jQuery
    • Juniper
    • Linux
    • Mac
    • PHP
    • Python
    • Server&OS
    • Software
    • SQL server
    • Sublime Text
    • Ubuntu
    • Visual Studio
    • Vmware
    • Web Design
    • Web Development
    • Windows
    • WordPress
    • 未分類
    • 未分類

    彙整

    分類

    • Ajax
    • Android
    • ASP
    • ASP.NET MVC
    • Azure
    • C#
    • Cisco
    • CSS
    • Delphi
    • Developer Tools
    • Framework
    • FreeBSD
    • Git
    • HTML5
    • javascript
    • jQuery
    • Juniper
    • Linux
    • Mac
    • PHP
    • Python
    • Server&OS
    • Software
    • SQL server
    • Sublime Text
    • Ubuntu
    • Visual Studio
    • Vmware
    • Web Design
    • Web Development
    • Windows
    • WordPress
    • 未分類
    • 未分類

    其他操作

    • 登入
    • 訂閱網站內容的資訊提供
    • 訂閱留言的資訊提供
    • WordPress.org 台灣繁體中文
    © 2025 Note | Powered by Superbs Personal Blog theme