css property condition Hack

<!--[if IE]>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
        <p>只在IE浏览器显示</p>
    </body>
</html>
<![endif]-->

This code can only be displayed in IE inside the results are as follows:

 

 For example, you can not use Firefox Google effect is as follows:

 

 

 

 Google will not display this code inside a browser compatibility issue resolved!

Hack definition and usage conditions

<!--[if <keywords>? IE <version>?]>
HTML代码块
<![endif]-->

 

Conditions Hack property value

<keywords>

if condition consists of six possible options: whether to, greater than, greater than, or equal to, less than, less than, or equal to, the non-specified version

whether:
Specify whether a version of IE or IE. Keywords: empty
more than the:
Select version than the specified version of IE. Keywords: gt (Greater Within last)
greater than or equal to:
IE version greater than or equal to select the specified version. Keywords: GTE (Greater Within last or equal is)
Less than:
Select IE version than the specified version. Keywords: lt (less Within last)
less than or equal to:
IE version less than or equal to select the specified version. Keywords: lte (or equal is less Within last)
Non-specified version:
Select all IE versions except the specified version. Keywords: !
<version>

The current common IE version 6.0 and above, as appropriate, recommend ignoring the low version, he will devote himself to advanced browser users to provide a better experience

Conditions Hack Description

For selecting different versions of IE and IE browser
  • if condition is HTML Hack level (but not exclusively comprising the CSS Hack, you can select any HTML code block)

 

 

 

Guess you like

Origin www.cnblogs.com/niuyaomin/p/11521285.html