標籤:microsoft log lang 索引值 最新 res 到期 搜尋引擎 日期
目錄:
1、定義
2、用法
2.1 設定網頁的定時跳轉
2.2 設定有效日期
2.3 禁止從緩衝中調用
2.4 刪除到期的cookie
2.5 註明作者、網頁描述
內容
1、定義
<meta>元素可提供有關頁面的元資訊,比如針對搜尋引擎和更新頻度的描述和關鍵詞。
<meta>標籤位於文檔的頭部,不包含任何內容,多是索引值對。
2、內容
2.1 設定網頁的定時跳轉
在該文法中,refresh表示網頁的重新整理,而在content中設定重新整理的時間和重新整理之後的重新連結地址。預設情況下,跳轉的時間是以秒為單位的。
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="3;url=http://www.baidu.com"/> <title>設定網頁的定時跳轉</title></head><body> 本頁面在3秒之後將自動跳轉到百度首頁</body></html>
2.2 設定有效日期
在某些網站上會設定網頁的到期時間,一旦到期則必須到伺服器上重新調用。
在該文法中,到期的時間必須是GMT格式。即星期 日 月 年 時 分 秒。
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <meta http-equiv="expires" content="Wed,14 september 2017 16:20:00 GMT"/> <title>設定有效期間限</title></head><body></body></html>
2.3 禁止從緩衝中調用
使用網頁緩衝可以加快網頁的瀏覽速度,但是如果網頁的內容經常更新,網頁製作者希望使用者隨時都能夠查到最新的網頁內容,則可以通過meta語句禁止網頁緩衝
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache"/> <title>禁止從緩衝中調用</title></head><body></body></html>
2.4 刪除到期的cookie
如果網頁到期,則刪除存檔的cookie
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <meta http-equiv="set-cookie" content="Web,14 september 2017 16:20:00 GMT"/> <title>刪除到期的cookie</title></head><body></body></html>
2.5 註明作者、網頁描述
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <meta name="author" content="Cassie" /> <meta name="description" content="test" /> <title>註明作者、網頁描述</title></head><body></body></html>
html5 中 meta 標籤的使用