运用meta标签进行网站优化使用说明
一,常用的HTTP-EQUIV类型:
Set-Cookie(cookie设定)
<meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Wednesday,21-Oct-98 16:14:21 GMT;path=/">
Window-target(显示窗口的设定)
<meta http-equiv="Window-target" content="_top">
Content-Type(显示字符集的设定)
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
expires(期限)
<meta http-equiv="expires" content="Wed, 26 Feb 2016 08:21:57GMT">
Pragma(cache模式)
<meta http-equiv="Pragma" content="no-cache">
Refresh(刷新)
<meta http-equiv="refresh" content="5;url=www.fly63.com">
二,meta标签name变量语法
keywords(关键字)—已经过时
<meta name="keywords" content="xxx">
description(简介)——(import)
<meta name="description" content="xxx">
robots(机器人向导)——(import)
<meta name="robots" content="none">
author(作者)
<meta name="author" content="huangqingmei">
notranslate—-(important)
<meta name=”google”content=”notranslate” />
三,以下是一些不常用的例子和简要的说明
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="googlebot" content="index,follow" />
<meta name="verify" content="index,follow" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="google" content="index,follow" />
启用WebAPP全屏模式
<meta name="apple-mobile-web-app-capable" content="yes" />
隐藏状态栏/设置状态栏颜色:只有在开启WebApp全屏模式时才生效。content的值为default | black | black-translucent 。
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
添加到主屏后的标题
<meta name="apple-mobile-web-app-title" content="标题">
忽略数字自动识别为电话号码
<meta content="telephone=no" name="format-detection" />
忽略识别邮箱
<meta content="email=no" name="format-detection" />
针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓
<meta name="HandheldFriendly" content="true">
微软的老式浏览器
<meta name="MobileOptimized" content="320">
uc强制竖屏
<meta name="screen-orientation" content="portrait">
QQ强制竖屏
<meta name="x5-orientation" content="portrait">
UC强制全屏
<meta name="full-screen" content="yes">
QQ强制全屏
<meta name="x5-fullscreen" content="true">
UC应用模式
<meta name="browsermode" content="application">
QQ应用模式
<meta name="x5-page-mode" content="app">
windows phone 点击无高光
<meta name="msapplication-tap-highlight" content="no">
四,实例
在html页面上设置不缓存
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">