html5 中 meta 標籤的使用

來源:互聯網
上載者:User

標籤: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 標籤的使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.