zoukankan      html  css  js  c++  java
  • 使用line-height来垂直居中在安卓设备并不居中,利用ji调整

    先判断智能机浏览器的版本信息:方法有两种,但是第一种兼容性更好,但是使用了device插件

    第一种:

    if (device.android())
    {    }

    第二种:

    var ua = navigator.userAgent.toLowerCase();//获取浏览器的userAgent,并转化为小写——注:userAgent是用户可以修改的

    var isAndroid = ua.indexOf('android') != -1;//判断是否是安卓手机,是则是true

    if (isAndroid) {    }

    /*


    * 智能机浏览器版本信息:
    *
    */
    document.write("<style>");
    if (device.android())
    {
    document.write(".badge{padding-top:3px}");
    document.write(".btn .ct{line-height:22px}");
    document.write(".btn.btn-20 .ct{padding-top:1px;}");
    document.write(".btn.btn-lg .ct{line-height:20px}");
    document.write(".btn.btn-xl .ct{line-height:38px}");
    document.write(".btn.btn-lg .badge{margin-top:-1px}");
    document.write(".btn.btn-xl .badge{margin-top:7px}");
    }
    //document.write(".badge{padding-top:2px}");
    //document.write(".btn.btn-20 .ct{padding-top:1px;}");
    //document.write(".btn.btn-lg .ct{padding-top:1px;}");
    //document.write(".btn.btn-xl .ct{line-height:38px}");



    document.write("</style>");

  • 相关阅读:
    函数的返回值以及局部,全局变量
    函数的参数
    文件操作 函数
    数据类型一些基本操作方法
    设置精度的方法
    字符串和编码问题
    python中一些函数应用
    初步认识类
    P1613 跑路
    P2383 狗哥玩木棒
  • 原文地址:https://www.cnblogs.com/LChenglong/p/6667303.html
Copyright © 2011-2022 走看看