2

Meta的http-equiv属性详解

 1 year ago
source link: https://blogread.cn/it/article/2676?f=hot1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Meta的http-equiv属性详解

浏览:2456次  出处信息

转自:http://hi.baidu.com/pingpingzi188/blog/item/907a64820f8292a60cf4d2ec.html

今天,在看一个专题页面的时候,发现翻页时页面的效果很帅。以为是用js实现的呢,不过查看原代码后,偶震惊了。因为里面没有任何 script 标签,同时页面有两个奇怪的 meta 标签。所以我发现,原来 meta 也有这么多的东西,悲哀了。

<meta http-equiv="Window-target" content="_top" />

<meta http-equiv="Page-Enter" content="BlendTrans(enabled=true,

percent=10)">

1、Expires(期限)

说明:可以用于设定网页的到期时间。一旦网页过期,必须到服务器上重新传输。

用法:<meta http-equiv=”expires” content=”Wed, 20 Jun 2007 22:33:00 GMT”>

注意:必须使用GMT的时间格式。

2、Pragma(cache模式)

说明:禁止浏览器颖镜丶扑慊 幕捍嬷蟹梦室趁婺谌荨?br>
用法:<meta http-equiv=”Pragma” content=”no-cache”>

注意:这样设定,访问者将无法脱机浏览。

3、Refresh(刷新)

说明:自动刷新并指向新页面。

用法:<meta http-equiv=”Refresh” content=”2;URL=http://www.net.cn/”>

注意:其中的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=/”>

注意:必须使用GMT的时间格式。

5、Window-target(显示窗口的设定)

说明:强制页面在当前窗口以独立页面显示。

用法:<meta http-equiv=”Window-target” content=”_top”>

注意:用来防止别人在框架里调用自己的页面。

6、content-Type(显示字符集的设定)

说明:设定页面使用的字符集。

用法:<meta http-equiv=”content-Type” content=”text/html; charset=gb2312″>

7、Pics-label(网页等级评定)

用法: 网页等级评定

说明:在IE的internet选项中有一项内容设置,可以防止浏览一些受限制的网站,而网站的限制级别就是通过meta属性来设置的。

还有Page_Enter、Page_Exit……


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK