< meta > 元素

  概要

標(biāo)簽提供關(guān)于HTML文檔的元數(shù)據(jù)。元數(shù)據(jù)不會(huì)顯示在頁(yè)面上,但是對(duì)于機(jī)器是可讀的。它可用于瀏覽器(如何顯示內(nèi)容或重新加載頁(yè)面),搜索引擎(關(guān)鍵詞),或其他 web 服務(wù)。

  必要屬性

屬性 描述
content some text 定義與http-equiv或name屬性相關(guān)的元信息

  可選屬性

屬性 描述
http-equiv content-type / expire / refresh / set-cookie 把content屬性關(guān)聯(lián)到HTTP頭部。
name author / description / keywords / generator / revised / others 把 content 屬性關(guān)聯(lián)到一個(gè)名稱(chēng)。
content some text 定義用于翻譯 content 屬性值的格式。

  SEO優(yōu)化

  參考文檔

<meta name="keywords" content="your tags" />
<meta name="description" content="150 words" />
<meta name="robots" content="index,follow" />
<!--
    all:文件將被檢索,且頁(yè)面上的鏈接可以被查詢(xún);
    none:文件將不被檢索,且頁(yè)面上的鏈接不可以被查詢(xún);
    index:文件將被檢索;
    follow:頁(yè)面上的鏈接可以被查詢(xún);
    noindex:文件將不被檢索,但頁(yè)面上的鏈接可以被查詢(xún);
    nofollow:文件將不被檢索,頁(yè)面上的鏈接可以被查詢(xún)。
 -->
<meta http-equiv="refresh" content="0;url=" />
<meta name="author" content="author name" /> <!-- 定義網(wǎng)頁(yè)作者 -->
<meta name="google" content="index,follow" />
<meta name="googlebot" content="index,follow" />
<meta name="verify" content="index,follow" />

  移動(dòng)設(shè)備

<meta name="viewport" content="width=device-width; initial-scale=1.0;maximum-scale=1.0; user-scalable=no;"/>
<!-- `width=device-width` 會(huì)導(dǎo)致 iPhone 5 添加到主屏后以 WebApp 全屏模式打開(kāi)頁(yè)面時(shí)出現(xiàn)黑邊  -->
  1. width:寬度(數(shù)值 / device-width)(范圍從200 到10,000,默認(rèn)為980 像素)
  2. height:高度(數(shù)值 / device-height)(范圍從223 到10,000)
  3. initial-scale:初始的縮放比例 (范圍從>0 到10)
  4. minimum-scale:允許用戶(hù)縮放到的最小比例
  5. maximum-scale:允許用戶(hù)縮放到的最大比例
  6. user-scalable:用戶(hù)是否可以手動(dòng)縮 (no,yes)
  7. minimal-ui:可以在頁(yè)面加載時(shí)最小化上下?tīng)顟B(tài)欄。(已棄用)

  注意,很多人使用initial-scale=1到非響應(yīng)式網(wǎng)站上,這會(huì)讓網(wǎng)站以100%寬度渲染,用戶(hù)需要手動(dòng)移動(dòng)頁(yè)面或者縮放。如果和initial-scale=1同時(shí)使用user-scalable=no或maximum-scale=1,則用戶(hù)將不能放大/縮小網(wǎng)頁(yè)來(lái)看到全部的內(nèi)容。

<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="標(biāo)題">

圖片描述圖片描述圖片描述

<meta content="telephone=no" name="format-detection" /> 
<meta content="email=no" name="format-detection" />
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL"> 

![Alt text](./IMG_3701.jpg)

<!-- 針對(duì)手持設(shè)備優(yōu)化,主要是針對(duì)一些老的不識(shí)別viewport的瀏覽器,比如黑莓 -->
<meta name="HandheldFriendly" content="true">
<!-- 微軟的老式瀏覽器 -->
<meta name="MobileOptimized" content="320">
<!-- uc強(qiáng)制豎屏 -->
<meta name="screen-orientation" content="portrait">
<!-- QQ強(qiáng)制豎屏 -->
<meta name="x5-orientation" content="portrait">
<!-- UC強(qiáng)制全屏 -->
<meta name="full-screen" content="yes">
<!-- QQ強(qiáng)制全屏 -->
<meta name="x5-fullscreen" content="true">
<!-- UC應(yīng)用模式 -->
<meta name="browsermode" content="application">
<!-- QQ應(yīng)用模式 -->
<meta name="x5-page-mode" content="app">
<!-- windows phone 點(diǎn)擊無(wú)高光 -->
<meta name="msapplication-tap-highlight" content="no">

  網(wǎng)頁(yè)相關(guān)

<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- 關(guān)于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 name="renderer" content="webkit|ie-comp|ie-stand">

  國(guó)內(nèi)雙核瀏覽器默認(rèn)內(nèi)核模式如下:

  1. 搜狗高速瀏覽器、QQ瀏覽器:IE內(nèi)核(兼容模式)

  2. 360極速瀏覽器、遨游瀏覽器:Webkit內(nèi)核(極速模式)

<meta http-equiv="Pragma" content="no-cache">
<meta name="msapplication-TileColor" content="#000"/> <!-- Windows 8 磁貼顏色 -->
<meta name="msapplication-TileImage" content="icon.png"/> <!-- Windows 8 磁貼圖標(biāo) -->
<meta name="mobile-agent"content="format=[wml|xhtml|html5]; url=url">
<!--
[wml|xhtml|html5]根據(jù)手機(jī)頁(yè)的協(xié)議語(yǔ)言,選擇其中一種;
url="url" 后者代表當(dāng)前PC頁(yè)所對(duì)應(yīng)的手機(jī)頁(yè)URL,兩者必須是一一對(duì)應(yīng)關(guān)系。
 -->
<meta http-equiv="Cache-Control" content="no-siteapp" />

  哈爾濱品用軟件有限公司致力于為哈爾濱的中小企業(yè)制作大氣、美觀的優(yōu)秀網(wǎng)站,并且能夠搭建符合百度排名規(guī)范的網(wǎng)站基底,使您的網(wǎng)站無(wú)需額外費(fèi)用,即可穩(wěn)步提升排名至首頁(yè)。歡迎體驗(yàn)最佳的哈爾濱網(wǎng)站建設(shè)。