meta標簽是html語言head區的一個輔助性標簽
meta通常用來為搜索引擎定義頁面的主題,或為用戶的瀏覽器設置cookie, 用於鑒別作者設置頁面格式等
meta 標簽分為兩個部分:http標題信息(http-equiv)頁面描述信息(name)
http-equiv
http-equiv類似http的協議頭,它回應給瀏覽器一些有用的信息,以幫助瀏覽器正確和精確的顯示網頁內容
如 content-Type content-Language refresh(多久刷新) Expires Pragma(禁止瀏覽器從本地機的緩存中調閱頁面內容)
Set-Cookie (cookie設定)
<Meta http-equiv="Content-Type" Content="text/html; Charset=gb2312">
<Meta http-equiv="Content-Language" Content="zh-CN">
<Meta http-equiv="Refresh" Content="5; Url=http://www.xia8.net"> // 其中的5是指停留5秒鍾后自動刷新到URL網址
<Meta http-equiv="Expires" Content="Wed, 26 Feb 1997 08:21:57 GMT"> //必須使用GMT的時間格式,或直接設為0(數字表示多少時間后過期)。
<Meta http-equiv="Set-Cookie" Content="cookievalue=xxx; expires=Wednesday,
21-Oct-98 16:14:21 GMT; path=/">
Window-target (顯示窗口的設定) 強制頁面在當前窗口以獨立頁面顯示
<Meta http-equiv="Widow-target" Content="_top">
這個屬性是用來防止別人在框架里調用你的頁面。Content選項:_blank、_top、_self、_parent.
Page-Enter、Page-Exit (進入與退出)這個是頁面被載入和調出時的一些特效
<Meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)">
<Meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">
name
1、Keywords (關鍵字)
用法:<Meta name="Keywords" Content="關鍵詞1,關鍵詞2,關鍵詞3,關鍵詞4,……">
2、Description (簡介)
說明:Description用來告訴搜索引擎你的網站主要內容。
用法:<Meta name="Description" Content="你網頁的簡述">
4、Author (作者)
用法:<Meta name="Author" Content="張三,abc@sina.com">
5、Copyright (版權)
<Meta name="Copyright" Content="本頁版權歸Zerospace所有。All Rights Reserved">