<meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-sc
2014-06-05 12:19
676 查看
网页手机wap2.0网页的head里加入下面这条元标签,在iPhone的浏览器中页面将以原始大小显示,并不允许缩放。
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
width - viewport的宽度 height - viewport的高度
initial-scale - 初始的缩放比例
minimum-scale - 允许用户缩放到的最小比例
maximum-scale - 允许用户缩放到的最大比例
user-scalable - 用户是否可以手动缩放
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
width - viewport的宽度 height - viewport的高度
initial-scale - 初始的缩放比例
minimum-scale - 允许用户缩放到的最小比例
maximum-scale - 允许用户缩放到的最大比例
user-scalable - 用户是否可以手动缩放
<meta name="apple-touch-fullscreen" content="yes">"添加到主屏幕“后,全屏显示 <meta name="apple-mobile-web-app-capable" content="yes" /> 这meta的作用就是删除默认的苹果工具栏和菜单栏。content有两个值”yes”和”no”,当我们需要显示工具栏和菜单栏时,这个行meta就不用加了,默认就是显示。 <meta name=”apple-mobile-web-app-status-bar-style” content=black” /> 默认值为default(白色),可以定为black(黑色)和black-translucent(灰色半透明)。 注意: 若值为“black-translucent”将会占据页面px位置,浮在页面上方(会覆盖页面20px高度–iphone4和itouch4的Retina屏幕为40px)。 在iOS中有两个meta值,apple-mobile-web-app-capable和apple-mobile-web-app-status-bar-style,这两个会让网页内容以应用程序风格显示,并使状态栏透明。 <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <link rel="apple-touch-icon-precomposed" href="http://spion.blog.163.com/blog/iphone_milanoo.png" /> 说明: 这个link就是设置web app的放置主屏幕上icon文件路径。 图片尺寸可以设定为57*57(px)或者Retina可以定为114*114(px),ipad尺寸为72*72(px) <meta content="telephone=no" name="format-detection" /> <meta content="email=no" name="format-detection" />//将不识别邮箱 告诉设备忽略将页面中的数字识别为电话号码 iOS用rel="apple-touch-icon",android 用rel="apple-touch-icon-precomposed"。这样就能在用户把网页存为书签时,在手机HOME界面创建应用程序样式的图标。 <link rel="apple-touch-icon" href="/static/images/identity/HTML5_Badge_64.png" /> <link rel="apple-touch-icon-precomposed" href="/static/images/identity/HTML5_Badge_64.png" />
相关文章推荐
- 关于<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-sc..
- <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-sc
- 关于<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-sc..
- <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-sc
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalab
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>解释
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalab
- <meta name="viewport" content="width = device-width,initial-scale=1.0,maximum-scale=1.0, user-scalab
- 释义:<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-
- 关于 <meta name="viewport" content="width=device-width, initial-scale=1.0">的解释
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scal
- <meta name="viewport" content="width=device-width, initial-scale=1.0>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>含义
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>解释
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
- 分析<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable