170314Css hacks

来源:互联网 发布:java接口接收json数据 编辑:程序博客网 时间:2024/05/22 03:18

Css hacks——使css代码兼容不同浏览器

         三种形式:

               内部(属性)hack:语法 selector{<hack>?property:value<hack>?;}

                   例如:

                       .test{

                          Color:#c00;

                          Color:#00f\9;  /* 兼容ie6+ */

                        }

 

                     [;property:value;];——》最后一条规则生效

        选择器hack:语法 <hack> selector{sRules}

            例如:

                  *html .test{color:#090;}       /* for ie6 and earlier */

                  *+html .test{color:#090;}       /*for ie7 */

                  .test:lang(zh-cn){color:#090;}       /* for ie8+ and not ie */

 

          HTML头部引用(if iehack

               <!-- [if ie]>   <![endif]-->    /* ie 浏览器生效 */

               <!-- [if ie6]>   <![endif]-->    /* ie6 浏览器生效 */

0 0
原创粉丝点击