zoukankan      html  css  js  c++  java
  • Hack、自适应、针对浏览器写样式随手笔记

    1.hack
    “-″减号是IE6专有的hack
    * IE6 、IE7识别
    “9″ IE6/IE7/IE8/IE9/IE10都生效
    “″ 是IE8的hack
    “9″ 是IE9/10的hack

    符号
    IE6 IE7 IE8 FF
    * √ √ × ×
    !important × √ × √
    _ √ × × ×
    9 × × √ ×
    *html √ × × ×
    *+html × √ × ×

    <!–[if IE 5]>仅IE5.5可见<![endif]–>
    <!–[if gt IE 5.5]>仅IE 5.5以上可见<![endif]–>
    <!–[if lt IE 5.5]>仅IE 5.5以下可见<![endif]–>
    <!–[if gte IE 5.5]>IE 5.5及以上可见<![endif]–>
    <!–[if lte IE 5.5]>IE 5.5及以下可见<![endif]–>
    <!–[if !IE 5.5]>非IE 5.5的IE可见<![endif]–>

    2.CSS3针对浏览器的写法

    动画转换
    例:transform:translate{200px,100px;}
    -webkit-transform:translate{200px,100px;} /*safari,chrome*/
    -ms-transform:translate{200px,100px;} /* IE */
    -o-transform:translate{200px,100px;} /*opera*/
    -moz-transform:translate{200px,100px;} /*Firefox*/

    3.自适应:<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=false;" name="viewport">

      苹果4 @media screen and (max- 350px) {.title3{ padding-top:20px;}
      .time{ padding-top:20px;}
      两个条件连接中间用and连接。例如:@media screen and (min- 350px)and(max-500px) {.title3{ padding-top:0px;}

    4.针对浏览器写样式:

     @-moz-document url-prefix() { .selector { property: value; } }针对火狐写样式 hack
     例子:@-moz-document url-prefix(){ .demo{color:lime;}}

     Webkit枘核浏览器(chrome and safari)
     @media screen and (-webkit-min-device-pixel-ratio:0) { Selector { property: value; } }
     例子: @media screen and (-webkit-min-device-pixel-ratio:0) { .demo { color: #f36; } }

  • 相关阅读:
    使用JMeter进行RESTful API测试
    Jmeter中Websocket协议支持包的使用
    JMeterPlugins插件监听器学习-监听器
    Jmeter实现WebSocket协议的接口和性能测试方法
    使用JMeter创建数据库(Mysql)测试
    jmeter --JVM调优设置
    Android 开发者不得不面对的六个问题
    年底盘点之十大开源安全工具
    作为一个程序员怎么通过android开发赚钱
    新手做2D手游该用哪些工具?
  • 原文地址:https://www.cnblogs.com/gzya/p/5091398.html
Copyright © 2011-2022 走看看