美文网首页
h5中meta标签的各种功能

h5中meta标签的各种功能

作者: Ordenme | 来源:发表于2019-05-23 19:11 被阅读0次
<meta name=”apple-mobile-web-app-title” content=”标题”> iOS 设备 begin

<meta name=”apple-mobile-web-app-capable” content=”yes”/> 是否启用 WebApp 全屏模式,删除苹果默认的工具栏和菜单栏 
                                                          如果content设置为yes,Web应用会以全屏模式运行,反之,则不会。
                                                          content的默认值是no,表示正常显示你可以通过只读属性window.navigator.standalone来确定网页是否以全屏模式显示。

<meta name=”apple-mobile-web-app-status-bar-style” content=”black”/>  设置Web App的状态栏(屏幕顶部栏)的样式。
        1. 除非你先使用apple-mobile-web-app-capable指定全屏模式,否则这个meta标签不会起任何作用。
        2. 如果content设置为default,则状态栏正常显示。
        3. 如果设置为blank,则状态栏会有一个黑色的背景。
        4. 如果设置为blank-translucent,则状态栏显示为黑色半透明。
        5. 如果设置为default或blank,则页面显示在状态栏的下方,即状态栏占据上方部分,页面占据下方部分,二者没有遮挡对方或被遮挡。
        6. 如果设置为blank-translucent,则页面会充满屏幕,其中页面顶部会被状态栏遮盖住(会覆盖页面20px高度,而iphone4和itouch4的Retina屏幕为40px)。
        7. 默认值是default。       兼容性  iOS 2.1 +
<meta name=”viewport” 
      content=”initial-scale=1, 
      maximum-scale=3,
      minimum-scale=1, 
      user-scalable=no”>                                              为移动设备添加 viewport
<meta name="format-detection" content="telephone=no">                 启动或禁用自动识别页面中的电话号码

<meta name=”screen-orientation” content=”portrait”>                   UC强制竖屏
<meta name=”full-screen” content=”yes”>                               UC强制全屏
<meta name=”browsermode” content=”application”>                       UC应用模式

<meta name=”x5-orientation” content=”portrait”>                       QQ强制竖屏
<meta name=”x5-fullscreen” content=”true”>                            QQ强制全屏
<meta name=”x5-page-mode” content=”app”>                              QQ应用模式

<meta name=”renderer” content=”webkit”>                               启用360浏览器的极速模式(webkit)
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>       优先使用 IE 最新版本和 Chrome。
<meta name=”HandheldFriendly” content=”true”>                         针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓
<meta name=”MobileOptimized” content=”320″>                           微软的老式浏览器
<meta http-equiv=”Cache-Control” content=”no-siteapp” />              不让百度转码
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>                 避免IE使用兼容模式
<meta name=”apple-itunes-app” 
      content=”app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL”>
                                                                      添加智能 App 广告条 Smart App Banner(iOS 6+ Safari)

<meta name=”description” content=”不超过150个字符”/>                    页面描述
<meta name=”keywords” content=””/>                                    页面关键词
<meta name=”author” content=”name, email@gmail.com”/>                 网页作者
<meta name=”robots” content=”index,follow”/>                          搜索引擎抓取 content中的值决定允许抓取的类型,必须同时包含两个值:
                                                                      是否允许索引(index)和是否跟踪链接(follow,也可以理解为是否允许沿着网页中的超级链接继续抓取)。
                                                                      1. index,follow:允许抓取本页,允许跟踪链接。
                                                                      2. index,nofollow:允许抓取本页,但禁止跟踪链接。
                                                                      3. noindex,follow:禁止抓取本页,但允许跟踪链接。
                                                                      4. noindex,nofllow:禁止抓取本页,同时禁止跟踪本页中的链接。
                                                                      以上1和4还有另一种写法:
                                                                      index,follow可以写成all,如:
                                                                      <meta name="robots" content="all" />
                                                                      noindex,nofollow可以写成none,如:
                                                                      <meta name="robots" content="none" />
<meta name=”msapplication-tap-highlight” content=”no”>                windows phone 点击无高光 设置页面不缓存

<meta http-equiv=”pragma” content=”no-cache”>
<meta http-equiv=”cache-control” content=”no-cache”>
<meta http-equiv=”expires” content=”0″>                               以上三个meta标签是清除浏览器中的缓存,它和其它几句合起来用,
                                                                      就可以使你再次进入曾经访问过的页面时,
                                                                      必须从服务端下载最新的内容,达到刷新的效果


相关文章

网友评论

      本文标题:h5中meta标签的各种功能

      本文链接:https://www.haomeiwen.com/subject/cyhvzqtx.html