<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=0.5,minimum-scale=0.5,maximum-scale=1">(灰色部分可以不写)

viewport 视口(可视区窗口)

默认不设置viewport一般可视区宽度在移动端是980

width 可视区的宽度(number||device-width)

user-scalable 是否允许用户缩放(yes||no)  注:ios10无效

initial-scale 初始缩放比例  minimun-scale 最小缩放比例(initial-scale与minimum-scale是需要保持一致的) maximum-scale 最大缩放比例   注意:ios10最大缩放比例无效

像素比:

<script>

  alert(window.devicePixelRatio);

//n=window.devicePixelRatio;

  //像素比把一个像素放大至N个像素去显示

  //设计图最少750

</script>

QQ浏览器强制竖屏还是横屏显示:portrait--竖屏  landscape--横屏

<meta name="x5-orientation"  content="portrait"/>

QQ浏览器全屏显示

<meta name="x5-fullscreen" content="true"/>

UC强制竖屏或横屏显示

<meta name="screen-orientation" content="portrait|landscape">

UC全屏显示

<meta name="full-screen" content="yes">

禁止识别电话号码和QQ

<meta name="format-detection" content="telephone=no,email=no"/>

拨打电话与发送邮件

<a href="tel:15371469791">请拨打电话15371469791</a>

<a href="mailto:284811638@qq.com">请发送邮件</a>

移动端问题解决:

<style type="text/css">

body{

  font-family:Helvetica;

}

body * {

  -webkit-text-size-adjust:100%;/*禁止文字缩放*/

  -webkit-user-select:none;

}

a,input,button{

-webkit-tap-highlight-color:rgba(0,0,0,0);/*清除点击阴影*/

}

input,button{

  -webkit-appearance:none;/*清除按钮圆角*/

  border-radius:0;

}

</style>

移动端其他问题:

1.Font Boosting :在一段文字我们没有给它设置高度的时候在webkit内核下文字的大小被浏览器放大了

  解决办法:

    1.设置高度

    2.设置最大高度 max-height

2.Fixed : 固定定位不兼容

  解决办法:

  <style>

    html{

     height:100%;

     overflow:hidden;

     position:relative;

    }

    body{

     height:100%;

     margin:0;

     overflow:auto;

    }

    header{

      position:absolute; /*用绝对定位去模拟固定定位,把html的滚动条隐藏,将滚动条加在body身上,根据html去定位*/

      width:100%;

      height:40px;

      background:rgba(0,0,0,0.5);

      color:#fff;

    }

    section{

      padding-top:40px;

    }

  </style>

    <header>我是头部</header>

    <section>

      页面内容<br/>

      页面内容<br/>

        。。。。。。

    </section>

3.IOS的body的overflow之后还是可以横向滚动

  解决办法:

  <style>

    html{

     height:100%;

     overflow:hidden;

    }

    body{

     height:100%;

     margin:0;

     overflow:hidden;

     position:relative;

    }

    #wrap{

     height:100%;

     overflow:auto;

    }

    header{

     position:absolute;

     width:200%;

     height:40px;

     background:rgba(0,0,0,0.5);

     color:#fff;

     text-align:center;

    }

    section{

      padding-top:40px;

    }

  </style>

  <div id="wrap">   //包一个div,根据body定位   

    <header>我是头部</header>

    <section>

      页面内容<br/>

      页面内容<br/>

      。。。。。。

    </section>

  </div>

最新文章

  1. Fedora10下建立linux系统的窗口没有地址栏
  2. EffectiveJava——用函数对象表示策略
  3. Shell中的变量
  4. Java 反射机制分析指南
  5. zepto API参考(~~比较全面)
  6. MySql Host is blocked because of many connection errors; unblock with &#39;mysqladmin flush-hosts&#39; 解决方法 -摘自网络
  7. 交互神器 Facebook Origami
  8. 学习spring中遇见的问题
  9. 【JVM】类加载机制
  10. pytorch visdom可视化工具学习—1—详细使用-2-plotting绘图
  11. SQL语言分类DQL,DML,DDL,DCL,DTL
  12. PyCharm+QTDesigner+PyUIC使用教程
  13. mongobooster 的使用
  14. 设置(更改)Mysql 自增ID的起始值
  15. STM32串口中断
  16. HttpUrlConnection使用详解--转
  17. 第五周PSP&amp;进度条
  18. navicat链接mysql
  19. springcloud9----feign-client-without-hystrix
  20. C# 能否获取一个对象所占内存的大小?

热门文章

  1. GIT版本控制系统(二)
  2. loj #547. 「LibreOJ β Round #7」匹配字符串
  3. Windows Server 2016 IIS10安装URLRewrite 2.0组件方法
  4. [HNOI2009]梦幻布丁 BZOJ1483 set
  5. Django---队列
  6. 圆环进度css
  7. phpsotrm 设置命名空间
  8. poj3274 找平衡数列(哈希加一点数学思维)
  9. 【CodeForces - 1034B】Little C Loves 3 II
  10. lintcode - 被围绕的区域