您的位置:首页 > Web前端 > HTML

html适配移动设备

2014-07-01 00:46 134 查看
一般做移动web的时候都会用到JQuery Mobile,可是把JQuery Mobile的CSS和JS文件引入以后怎么还是不能适配手机屏幕,原来是要加入一行

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">


这一条至关重要,意思是使html的width和设备屏幕width相等,且不让用户缩放网页,适配妥妥的

下面是完整的head

<span style="white-space:pre">	</span><link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: