[关闭]
@mansonchor 2014-04-02T08:58:11.000000Z 字数 2297 阅读 772

HTML前期实用属性配置

设置让窗口和屏幕等宽;禁止用户在屏幕双指缩放界面;并且兼容IPHONE 5的长度

  1. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  2. <meta name="viewport" content="initial-scale=1.0 , maximum-scale=1.0 , user-scalable=no" media="(device-height: 568px)" />

禁止手机浏览器自动识别电话号码和EMAIL

  1. <meta content="telephone=no" name="format-detection" />
  2. <meta content="email=no" name="format-detection" />

IOS safari把网址添加到桌面的时候,可以设置ICON,启动封面图等

  1. /*ICON各种size适配*/
  2. <link rel="apple-touch-icon-precomposed" sizes="57x57" href="images/app_icon-57x57.png" />
  3. <link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/app_icon-72x72.png" />
  4. <link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/app_icon-114x114.png" />
  5. <link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/app_icon-144x144.png" />
  6. /*启动封面各种size适配*/
  7. <!-- iPhone (Retina) -->
  8. <link href="images/start_up_640x920.png" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
  9. <!-- iPhone 5 -->
  10. <link href="images/start_up_640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
  11. <!-- iPad Portrait -->
  12. <link href="images/ipad_start_up_768x1004.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
  13. <!-- iPad Landscape -->
  14. <link href="images/ipad_start_up_1024x748.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
  15. <!-- iPad Portrait (Retina) -->
  16. <link href="images/ipad_start_up_1536x2008.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
  17. <!-- iPad Landscape (Retina) -->
  18. <link href="images/ipad_start_up_2048x1496.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
  19. /*桌面书签形式打开时,没有顶部状态栏*/
  20. <meta name="apple-mobile-web-app-capable" content="yes" />

解决横竖屏会出现字体加粗不一致情况

  1. html,body {
  2. -webkit-text-size-adjust: 100%;
  3. -ms-text-size-adjust: 100%;
  4. text-size-adjust: 100%;
  5. }

禁止用户长按行为和选中文字

  1. html,body { -webkit-touch-callout: none; -webkit-user-select: none; -webkit-tap-highlight-color: none; }

此处输入图片的描述

此处输入图片的描述

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注