HTML <meta> http-equiv 屬性
定義和用法
http-equiv
屬性為 content
屬性提供 HTTP 頭部資訊。
http-equiv
屬性可用於模擬 HTTP 響應頭部。
瀏覽器支援
Attribute | |||||
---|---|---|---|---|---|
http-equiv | 是 | 是 | 是 | 是 | 是 |
語法
<meta http-equiv="content-security-policy|content-type|default-style|refresh">
屬性值
值 | 描述 |
---|---|
content-security-policy | 為文件指定內容策略。 示例 <meta http-equiv="content-security-policy" content="default-src 'self'"> |
content-type | 指定文件的字元編碼。 示例 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
default-style | 指定首選樣式表。 示例 <meta http-equiv="default-style" content="文件的首選樣式表"> 注意: 上面 content 屬性的值必須與同一文件中 link 元素的 title 屬性值匹配,或者必須與同一文件中 style 元素的 title 屬性值匹配。 |
重新整理 | 定義文件的自動重新整理間隔。 示例 <meta http-equiv="refresh" content="300"> 注意:應謹慎使用 "refresh" 值,因為它會將頁面的控制權從使用者手中奪走。使用 "refresh" 會導致 W3C 的 Web 內容可訪問性指南 失敗。 |
❮ HTML <meta> 標籤