常用HTML meta 标签属性(网站兼容与优化需要)

2019-01-15 09:49:45王振洲
复制代码
<meta content="telephone=no" name="format-detection" />

忽略识别邮箱


复制代码
<meta content="email=no" name="format-detection" />

添加智能 App 广告条 Smart App Banner:告诉浏览器这个网站对应的app,并在页面上显示下载banner(如下图)。参考文档


复制代码
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">

其他 参考文档

  • <!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 -->   <meta name="HandheldFriendly" content="true">  
  • <!-- 微软的老式浏览器 -->   <meta name="MobileOptimized" content="320">  
  • <!-- uc强制竖屏 -->   <meta name="screen-orientation" content="portrait">  
  • <!-- QQ强制竖屏 -->   <meta name="x5-orientation" content="portrait">  
  • <!-- UC强制全屏 -->   <meta name="full-screen" content="yes">  
  • <!-- QQ强制全屏 -->   <meta name="x5-fullscreen" content="true">  
  • <!-- UC应用模式 -->   <meta name="browsermode" content="application">  
  • <!-- QQ应用模式 -->   <meta name="x5-page-mode" content="app">  
  • <!-- windows phone 点击无高光 -->   <meta name="msapplication-tap-highlight" content="no">  
  • 网页相关

    申明编码


    复制代码
    <meta charset='utf-8' />

    优先使用 IE 最新版本和 Chrome


    复制代码

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <!-- 关于X-UA-Compatible -->
    <meta http-equiv="X-UA-Compatible" content="IE=6" ><!-- 使用IE6 -->
    <meta http-equiv="X-UA-Compatible" content="IE=7" ><!-- 使用IE7 -->
    <meta http-equiv="X-UA-Compatible" content="IE=8" ><!-- 使用IE8 -->