移动端meta行大全

<meta name="viewport"content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />

width: viewport 的宽度 (范围从 200 到 10,000 ,默认为 980 像素 )
height: viewport 的高度 (范围从 223 到 10,000 )
initial-scale: 初始的缩放比例 (范围从>0到 10 )
minimum-scale: 允许用户缩放到的最小比例
maximum-scale: 允许用户缩放到的最大比例
user-scalable: 用户是否可以手动缩放


<meta name="apple-mobile-web-app-capable" content="yes" />

<meta name="renderer" content="webkit">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="HandheldFriendly" content="true">

<meta name="MobileOptimized" content="320">

<meta name="screen-orientation" content="portrait">

<meta name="x5-orientation" content="portrait">

<meta name="full-screen" content="yes">

<meta name="x5-fullscreen" content="true">

<meta name="browsermode" content="application">

<meta name="x5-page-mode" content="app">

<meta name="msapplication-tap-highlight" content="no">

  1. apple-touch-icon
    < link rel= "apple-touch-icon" sizes= "76x76" href= "touch-icon-ipad.png">
    如果 apple-mobile-web-app-capable 设置为 yes 了,
    那么在苹果机的safari上可以通过添加到主屏按钮将网站添加到主屏幕上。
    而设置相应 apple-touch-icon 标签,则添加到主屏上的图标就会使用我们指定的图片。

  2. apple-touch-startup-image
    < link rel= "apple-touch-startup-image" href= "/startup.png">
    基于 apple-mobile-web-app-capable 设置为 yes ,
    可以为WebApp设置一个类似NativeApp的启动画面。
    和 apple-touch-icon 不同,
    apple-mobile-web-app-capable 不支持sizes属性,
    要使用media来加载不同的启动画面。

// iPhone
<link href="apple-touch-startup-image-320x460.png" media="(device-width: 320px)" rel="apple-touch-startup-image" />

// iPhone Retina
<link href="apple-touch-startup-image-640x920.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)"rel="apple-touch-startup-image" />

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容