Windows Internet Explorer Web Windows Internet Explorer 8 version vector refers to the build number, which is stored in the registry key read when the browser starts. Developers can use the version vector to detect which version of the browser viewer is using to view the website. Understanding browser detection best practices ensures that the site continues to function as expected when the client views the site. Windows Internet Explorer Web This document describes how to use the value of the version vector. In addition, some sample code is provided to help developers implement and maintain recommended browser detection methods. ->Windows Internet Explorer HTML Windows Internet Explorer In addition to using the version vector when populating the Help About section, this value is also used when processing conditional comments. Conditional comments are comment blocks in the source code of the page and can only be interpreted by. Annotations may contain one or more operators, eigenvalues, or values. Windows Internet Explorer Version 8 Windows Internet Explorer For example, the above code shows the comment code required to check and later versions. Greater than or equal to the future version used to ensure that the conditions apply to, so that no code is required when a new version is released. The Windows Internet Explorer 5.5 5.5002 version vector also contains the browser subversion number. When testing the browser's main version number, the version vector is an integer. To check the browser's subversion number, the version vector is added with a decimal point and four digits. For example, the release version vector is. This code example shows the comment code required to check the browser's primary version number and the browser's secondary version number. This allows you to adjust the conditions appropriately further. – HTML [endif] downlevel-hidden downlevel-revealed The start and end tags of the conditional comment contain hyphen (""), which is similar to the basic comment. The condition is displayed in the beginning of the mark and placed before the end of the mark. The content is placed in the comment mark. These annotations are called comments of type, because all browsers or browser versions that do not support conditional annotations will ignore these annotations and tags between tags. Conditional comments without hyphen are called comments of type, because low-level browsers will ignore these comments, but will handle tags between tags. This code example shows the comment code required to check the browser's primary version number and the browser's secondary version number. This allows you to adjust the conditions appropriately further. Windows Internet Explorer (CSS) Windows Internet Explorer 8 Windows Internet Explorer 7 CSS uses user agent string 1 / usage condition comments include different cascading stylesheet rules for specific versions. This allows you to ensure that the client does not receive corrections and changes targeted. You can also detect browser versions. The table lists available eigenvalues, operators, and or values that can be used to make up conditional comments. item Example Comments IE [if IE] The only feature value currently supported by IE Windows Internet Explorer is the string "", which is used for representation. value [if IE 7] Boolean true An integer or floating point number is used to represent the browser version. Returns a value if the version number matches the browser version. ! [if !IE] NOT Boolean operator. Putting this operator directly before an eigenvalue, operator, or subexpression indicates the opposite meaning of the expression. lt [if lt IE 5.5] true is less than the operator. If the first parameter is smaller than the second parameter, return. lte [if lte IE 6] true is less than or equal to the operator. If the first parameter is less than or equal to the second parameter, return. gt [if gt IE 5] true is greater than the operator. If the first parameter is greater than the second parameter, return. gte [if gte IE 8] true is greater than or equal to the operator. If the first parameter is greater than or equal to the second parameter, return. ( ) [if !(IE 7)] Boolean subexpression operator. Used in conjunction with operators to create more complex expressions. & [if (gt IE 5)&(lt IE 7)] AND true true operator. If all subexpressions evaluate to, return. | [if (IE 6)|(IE 7)] OR true true operator. If the result of any subexpression is, it is returned. true [if true] true calculation result is always. false [if false] false calculation result is always. HTML <head> Windows Internet Explorer 7 Additionally, if you want to use the same stylesheet for versions and later, you can use the following sample code. HTML <head> Windows Internet Explorer Windows Internet Explorer Note that the above code example uses greater than or equal to comparison. This ensures that the code is suitable for future versions so that the code is not required to be updated when a new version is released. Here are some other examples of various conditional statements. How to use version vectors in Windows Internet Explorer
<!--[if gte IE8]>
<!--[if gte IE 5.5002]><p>You are using IE 5 or higher</p><![endif]–>
<![if lt IE 5.5]><p>
您正在使用早于
IE 5.5
的版本或另一个低级浏览器
</p><![endif]>
Browser detection using version vector
<title>test page</title>
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
<!–[if gte IE 8]> <linkrel="stylesheet" type="text/css" href="/stylesheets/standards.css" /> <![endif]—>
<!–[if IE 7]> <linkrel="stylesheet" type="text/css" href="/stylesheets/ie.css" />
<![endif]—>
</head>
<title>test page</title>
<!–[if gte IE 7]>
<linkrel="stylesheet" type="text/css" href="/stylesheets/ie.css" />
<![endif]->
</head><!--[if IE]><p>
您使用的是
Internet Explorer
。
</p><![endif]–>
<![if !IE]><p>
您没有使用高级
Internet Explorer
版本。
</p><![endif]>
<!--[if IE 8]><p>
欢迎使用
Internet Explorer 8
!
</p><![endif]–>
<!--[if !(IE 8)]><p>
您没有使用
Internet Explorer 8
。
</p><![endif]–>
<!--[if gte IE 7]><p>
您使用的是
IE 7
或更高版本。
</p><![endif]–>
<!--[if (IE 5)]><p>
您使用的是
IE 5
(任何版本)。
</p><![endif]–>
<!--[if (gte IE 5.5)&(lt IE 7)]><p>
您使用的是
IE 5.5
或
IE 6
。
</p><![endif]–>
<!--[if lt IE 5.5]><p>
请升级您的
Internet Explorer
版本。
</p><![endif]–>
<!--[if true]>
您使用的是
a <em>
高级
</em>
浏览器。
<![endif]–>
<!--[if false]>
您使用的是
a <em>
低级
</em>
浏览器。
<![endif]–>
<!--[if true]><![if IE 7]><p>
此嵌套注释在
is displayed in IE 7
中显示。
</p><![endif]><![endif]–>