常用的Meta標籤寫法和作用

常用的Meta標籤寫法和作用

 頁面關鍵詞
  <meta name="keywords" content="your tags" />

  頁面描述
  <meta name="description" content="150 words" />

  搜索引擎索引方式
  <meta name="robots" content="index,follow" />
  <!--
  all:文件將被檢索,且頁面上的鏈接可以被查詢;
  none:文件將不被檢索,且頁面上的鏈接不可以被查詢;
  index:文件將被檢索;
  follow:頁面上的鏈接可以被查詢;
  noindex:文件將不被檢索;
  nofollow:頁面上的鏈接不可以被查詢。
  -->

  頁面重定向和刷新
  <meta http-equiv="refresh" content="0;url=" />

  其他
  <meta name="author" content="author name" /> <!-- 定義網頁作者 -->
  <meta name="google" content="index,follow" />
  <meta name="googlebot" content="index,follow" />
  <meta name="verify" content="index,follow" />

  移動設備
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
  <!-- `width=device-width` 會導致 iPhone 5 添加到主屏後以 WebApp 全屏模式打開頁面時出現黑邊  -->

  WebApp全屏模式
  <meta name="apple-mobile-web-app-capable" content="yes" /> <!-- 啓用 WebApp 全屏模式 -->

  隱藏狀態欄/設置狀態欄顏色
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

  添加到主屏後的標題
  <meta name="apple-mobile-web-app-title" content="標題">

  忽略數字自動識別爲電話號碼
  <meta content="telephone=no" name="format-detection" />

  忽略識別郵箱
  <meta content="email=no" name="format-detection" />

  申明編碼
  <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 -->

  禁止瀏覽器從本地計算機的緩存中訪問頁面內容
  <meta http-equiv="Pragma" content="no-cache">
    瀏覽器不會自動調整文件的大小,也就是說是固定大小,不會隨着瀏覽器拉伸縮放。
    <meta name="MobileOptimized" content="240"/>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章