移动端专用的meta标签设置大全

2019-01-14 14:51:01王冬梅
:是否对手持设备友好,只有true或者false

UC浏览器

<meta name=”screen-orientation” content=”portrait”>  强制竖屏

<meta name=”full-screen” content=”yes”>  强制全屏

<meta name=”browsermode” content=”application”>  应用模式

QQ浏览器

<meta name=”x5-orientation” content=”portrait”>  强制竖屏

<meta name=”x5-fullscreen” content=”true”>  强制全屏

<meta name=”x5-page-mode” content=”app”>  应用模式

360浏览器

<meta name=”renderer” content=”webkit”>  开启急速模式

meta指元素可提供有关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词。 标签位于文档的头部,不包含任何内容。 标签的属性定义了与文档相关联的名称/值对。

手机端特有的有哪些?

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"> <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标签表示:强制让文档的宽度与设备的宽度保持1:1,并且文档最大的宽度比例是1.0,且不允许用户点击屏幕放大浏览;

width - viewport的宽度 height - viewport的高度   initial-scale - 初始的缩放比例  minimum-scale - 允许用户缩放到的最小比例   maximum-scale - 允许用户缩放到的最大比例  user-scalable - 用户是否可以手动缩放

第二个meta标签是iphone设备中的safari私有meta标签,它表示:允许全屏模式浏览;

第三个meta标签也是iphone的私有标签,它指定的iphone中safari顶端的状态条的样式;

在web app应用下状态条(屏幕顶部条)的颜色;

默认值为default(白色),可以定为black(黑色)和black-translucent(灰色半透明)。

注意:若值为“black-translucent”将会占据页面px位置,浮在页面上方(会覆盖页面20px高度–iphone4和itouch4的Retina屏幕为40px)。

第四个meta标签表示:告诉设备忽略将页面中的数字识别为电话号码。

下面看一下各大厂移动端页面 meta

一、天猫

<meta name="aplus-terminal" content="1"/> <meta name="apple-mobile-web-app-title" content="TMALL"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/> <meta name="format-detection" content="telephone=no, address=no">