http-equiv 属性详解

http-equiv 属性详解
http-equiv 相当于http的文件头,他向浏览器传回一些有用的信息,以帮助正确和精确地显示网页内容,与之对应的属性值为content,
content中的内容就是各个参数的变量值。
1、expires:可以用于设定网页的到期时间,一旦网页过期,必须到服务器上重新上传。
html代码:
<meta http-equiv="expires" content="Wed, 13 Jun 2017 22:33:00 GMT">
content必须使用GMT时间格式
2、Pargma(cache模式):用于设定禁止浏览器从本地机的缓存中调阅页面内容,设定后一旦离开网页就无法从cache中再调出
html代码:<meta http-equiv="Pragma" content="no-cache">
这样设置会导致访问者无法脱机浏览
3、Refresh(刷新):自动刷新并指向新页面。
html代码:<meta http-equiv="Refresh" content="2;URL = http://www.baidu.com">
其中:2是指停留2秒后自动刷新到URL地址
4、Set-Cookie(cookie设定):如果网页过期,那么存盘的cookie将被删除。
<meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Wednesday, 20-Jun-2007 22:33:00 GMT; path=/">
5、关键字:给搜索引擎用的
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
6、页面描述
<meta http-equiv="description" content="This is my page">
posted @ 2017-06-13 13:42  甜甜宝宝  阅读(1576)  评论(0)    收藏  举报