meta標籤設定

風暴阿呆發表於2017-12-14

meta 標籤常用設定

<!-- 根據瀏覽器的螢幕大小自適應的展現合適的效果 -->
<meta name="applicable-device" content="pc,mobile" />

<!-- 移動端 瀏覽器中頁面將以原始大小顯示,不允許縮放 -->
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />

<!-- 優先使用 IE 最新版本和 Chrome -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
//它必須顯示在網頁中除 title 元素和其他 meta 元素以外的所有其他元素之前。如果不是的話,它不起作用

<!-- iphone會把一串數字識別為電話號碼,點選的時候會提示是否呼叫,遮蔽這功能則把telephone設定為no -->
<meta content="telephone=no" name="format-detection" />

<!-- iphone的私有標籤,預設值為default(白色),可以定為black(黑色)和black-translucent(灰色半透明) -->
<meta content="black" name="apple-mobile-web-app-status-bar-style">

<!-- iphone裝置的是有標籤 允許全屏模式瀏覽,隱藏瀏覽器導航欄 -->
<meta content="yes" name="apple-mobile-web-app-capable" />

<!-- 全屏顯示 -->
<meta content="yes" name="apple-touch-fullscreen" />

<!-- UC強制全屏 -->
<meta name="full-screen" content="yes">

<!-- QQ強制全屏 -->
<meta name="x5-fullscreen" content="true">

<!-- 遮蔽百度轉碼 -->
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<!-- 定義網頁簡短描述 -->
<meta name="description" content="Cochemist">

<!-- 定義網頁關鍵詞 -->
<meta name="keywords" content="生物化學"> 

<!-- 定義網頁的作者 -->
<meta name="author" content="sun_Annie">

<!-- 避免HTML頁面快取 -->
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">

<!-- 定義網頁的快取過期時間 -->
<meta http-equiv="expires" content="Sunday 26 October 2016 00:00 GMT">
//由於這是一個過去的日期,所以這個網頁只要一開啟,就會直接到網站伺服器重新下載頁面內容,而不是從cache呼叫。這是一種防止網頁被cache快取的措施。
複製程式碼


相關文章