html页面适配android手机兼容笔记
04月14日
在后台服务器端把word文档转为html页面,显示在手机上时,出现了android显示异常(字体很小,右边和下边多了很多空白),IOS的没问题
于是在网上查了一些相关问题,原来缺少了meta的viewport定义,因为它用来告知移动设备这是一个移动页面,所以必不可少,最后在html页面的head区内加上了以下几句话即可完美适配手机(android和ios):
<head>
<meta name=”viewport” content=”initial-scale=1.0, maximum-scale=1.0, user-scalable=no” />
<meta content=”yes” name=”apple-mobile-web-app-capable” />
<meta content=”black” name=”apple-mobile-web-app-status-bar-style” />
<meta content=”telephone=no” name=”format-detection” />
<meta content=”email=no” name=”format-detection” />
要根据自己的情况而定,以上只是参考