发新话题
打印

meta标签使用详解

本帖已经被作者加入个人空间

meta标签使用详解

META标签分两大部分:HTTP标题信息(HTTP-EQUIV)和页面描述信息(NAME)。

HTTP-EQUIV
HTTP-EQUIV类似于HTTP的头部协议,它回应给浏览器一些有用的信息,以帮助正确和精确地显示网页内容。常用的HTTP-EQUIV类型有:

Content-Type和Content-Language (显示字符集的设定)
说明:设定页面使用的字符集,用以说明主页制作所使用的文字已经语言,浏览器会根据此来调用相应的字符集显示page内容
用法:<Meta http-equiv=”Content-Type” Content=”text/html; Charset=gb2312″>     <Meta http-equiv=”Content-Language” Content=”zh-CN”>
注意: 该META标签定义了HTML页面所使用的字符集为GB2132,就是国标汉字码。如果将其中的“charset=GB2312”替换成“BIG5”,则该页面所用的字符集就是繁体中文Big5码。当你浏览一些国外的站点时,IE浏览器会提示你要正确显示该页面需要下载xx语支持。这个功能就是通过读取HTML页面META标签的Content-Type属性而得知需要使用哪种字符集显示该页面的。如果系统里没有装相应的字符集,则IE就提示下载。其他的语言也对应不同的charset,比如日文的字符集是“iso-2022-jp ”,韩文的是“ks_c_5601”。
Content-Type的Content还可以是:text/xml等文档类型;
Charset选项:ISO-8859-1(英文)、BIG5、UTF-8、SHIFT-Jis、Euc、Koi8-2、us-ascii, x-mac-roman, iso-8859-2, x-mac-ce, iso-2022-jp, x-sjis, x-euc-jp,euc-kr, iso-2022-kr, gb2312, gb_2312-80, x-euc-tw, x-cns11643-1,x-cns11643-2等字符集;Content-Language的Content还可以是:EN、FR等语言代码。

Refresh (刷新)
说明:让网页多长时间(秒)刷新自己,或在多长时间后让网页自动链接到其它网页。
用法:<Meta http-equiv=”Refresh” Content=”30″>
<Meta http-equiv=”Refresh” Content=”5; Url=http://www.xia8.net”>
注意:其中的5是指停留5秒钟后自动刷新到URL网址。

Expires (期限)
说明:指定网页在缓存中的过期时间,一旦网页过期,必须到服务器上重新调阅。
用法:<Meta http-equiv=”Expires” Content=”0″>
<Meta http-equiv=”Expires” Content=”Wed, 26 Feb 1997 08:21:57 GMT”>
注意:必须使用GMT的时间格式,或直接设为0(数字表示多少时间后过期)。

Pragma (cach模式)
说明:禁止浏览器从本地机的缓存中调阅页面内容。
用法:<Meta http-equiv=”Pragma” Content=”No-cach”>
注意:网页不保存在缓存中,每次访问都刷新页面。这样设定,访问者将无法脱机浏览。

Set-Cookie (cookie设定)
说明:浏览器访问某个页面时会将它存在缓存中,下次再次访问时就可从缓存中读取,以提高速度。当你希望访问者每次都刷新你广告的图标,或每次都刷新你的计数器,就要禁用缓存了。通常HTML文件没有必要禁用缓存,对于ASP等页面,就可以使用禁用缓存,因为每次看到的页面都是在服务器动态生成的,缓存就失去意义。如果网页过期,那么存盘的cookie将被删除。
用法:<Meta http-equiv=”Set-Cookie” Content=”cookievalue=xxx; expires=Wednesday, 21-Oct-98 16:14:21 GMT; path=/”>
注意:必须使用GMT的时间格式。

Window-target (显示窗口的设定)
说明:强制页面在当前窗口以独立页面显示。
用法:<Meta http-equiv=”Widow-target” Content=”_top”>
注意:这个属性是用来防止别人在框架里调用你的页面。Content选项:_blank、_top、_self、_parent。

Page-Enter、Page-Exit (进入与退出)
说明:这个是页面被载入和调出时的一些特效。
用法:<Meta http-equiv=”Page-Enter” Content=”blendTrans(Duration=0.5)”>
<Meta http-equiv=”Page-Exit” Content=”blendTrans(Duration=0.5)”>
注意:blendTrans是动态滤镜的一种,产生渐隐效果。另一种动态滤镜RevealTrans也可以用于页面进入与退出效果:
<Meta http-equiv=”Page-Enter” Content=”revealTrans(duration=x, transition=y)”>
<Meta http-equiv=”Page-Exit” Content=”revealTrans(duration=x, transition=y)”>
Duration  表示滤镜特效的持续时间(单位:秒)
Transition 滤镜类型。表示使用哪种特效,取值为0-23。

NAME变量
name是描述网页的,对应于Content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。name的value值(name=”")指定所提供信息的类型。有些值是已经定义好的。例如description(说明)、keyword(关键字)、refresh(刷新)等。还可以指定其他任意值,如:creationdate(创建日期) 、document ID(文档编号)和level(等级)等。name的content指定实际内容。如:如果指定level(等级)为value(值),则Content可能是beginner(初级)、intermediate(中级)、advanced(高级)。

Keywords (关键字)
说明:为搜索引擎提供的关键字列表
用法:<Meta name=”Keywords” Content=”关键词1,关键词2,关键词3,关键词4,……”><
注意:各关键词间用英文逗号“,”隔开。META的通常用处是指定搜索引擎用来提高搜索质量的关键词。当数个META元素提供文档语言从属信息时,搜索引擎会使用lang特性来过滤并通过用户的语言优先参照来显示搜索结果。例如:
<Meta name="Kyewords" Lang="EN" Content="vacation,greece,sunshine">
<Meta name="Kyewords" Lang="FR" Content="vacances,grè:ce,soleil">

Description (简介)
说明:Description用来告诉搜索引擎你的网站主要内容。
用法:<Meta name=”Description” Content=”你网页的简述”>

Robots (机器人向导)
说明:Robots用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。Content的参数有all、none、index、noindex、follow、nofollow。默认是all。
用法:<Meta name=”Robots” Content=”All|None|Index|Noindex|Follow|Nofollow”>
注意:许多搜索引擎都通过放出robot/spider搜索来登录网站,这些robot/spider就要用到meta元素的一些特性来决定怎样登录。
all:文件将被检索,且页面上的链接可以被查询;
none:文件将不被检索,且页面上的链接不可以被查询;(和 “noindex, no follow” 起相同作用)

index:文件将被检索;(让robot/spider登录)
follow:页面上的链接可以被查询;
noindex:文件将不被检索,但页面上的链接可以被查询;(不让robot/spider登录)
nofollow:文件将不被检索,页面上的链接可以被查询。(不让robot/spider顺着此页的连接往下探找)

Author (作者)
说明:标注网页的作者或制作组
用法:<Meta name=”Author” Content=”张三,abc@sina.com“>
注意:Content可以是:你或你的制作组的名字,或Email

Copyright (版权)
说明:标注版权
用法:<Meta name=”Copyright” Content=”本页版权归Zerospace所有。All Rights Reserved”>

Generator (编辑器)
说明:编辑器的说明
用法:<Meta name=”Generator” Content=”PCDATA|FrontPage|”>
注意:Content=”你所用编辑器”

revisit-after (重访)
用法:<META name=”revisit-after” CONTENT=”7 days” >

Head中的其它一些用法
scheme (方案)
说明:scheme can be used when name is used to specify how the value of content should be interpreted.
用法:<meta scheme=”ISBN” name=”identifier” content=”0-14-043205-1″ />

Link (链接)
说明:链接到文件
用法:<Link xhref=”soim.ico” mce_href=”soim.ico” rel=”Shortcut Icon”>
注意:很多网站如果你把她保存在收件夹中后,会发现它连带着一个小图标,如果再次点击进入之后还会发现地址栏中也有个小图标。现在只要在你的页头加上这段话,就能轻松实现这一功能。<LINK> 用来将目前文件与其它 URL 作连结,但不会有连结按钮,用於 <HEAD> 标记间, 格式如下:
<link xhref=”URL” mce_href=”URL” rel=”relationship”>
<link xhref=”URL” mce_href=”URL” rev=”relationship”>

Base (基链接)
说明:插入网页基链接属性
用法:<Base xhref=”http://www.xia8.net/” target=”_blank”>
注意:你网页上的所有相对路径在链接时都将在前面加上“http://www.cn8cn.com/”。其中target=”_blank”是链接文件在新的窗口中打开,你可以做其他设置。将“_blank”改为“_parent”是链接文件将在当前窗口的父级窗口中打开;改为“_self”链接文件在当前窗口(帧)中打开;改为“_top”链接文件全屏显示。

TOP

不知该说些什么

提示: 作者被禁止或删除 内容自动屏蔽

TOP

水上步行球厂家0579-87368343

提示: 作者被禁止或删除 内容自动屏蔽

TOP

棉花糖机,炒冰机,洗面机,凉皮机,硬冰淇淋www.163abc.com

提示: 作者被禁止或删除 内容自动屏蔽

TOP

介绍一个冠心病治疗咨询网站

提示: 作者被禁止或删除 内容自动屏蔽

TOP

写得非常不错

032◎一恐龙路过西安交大传世私服时上了趟厕所,出来后她呜咽道:“555,这辈子终于不愁嫁不出去了……”
033◎生,容易。活,容易。生活,不容易
传奇私服
034◎吾表兄,年四
魔域私服十余。始从文,连考三年而不中。遂习武,练武场上发一矢,中鼓吏,逐之出。改学医,自撰一良方,服之,卒。
035◎问君能有几多愁,恰似一群太监上青楼……
036◎吾生也有涯,而吃
runescape也无涯~~~
037◎想污染一个地方有两种方法:垃圾,或是钞票!
38◎年轻的时候,我们常常冲着镜子做鬼脸;年老的时候,镜子算是扯平了。
039◎你瞎了眼啊?这么大的盾牌你看
私服论坛不见,偏偏要把石头朝我脑袋上扔!

TOP

支持!呵呵。

提示: 作者被禁止或删除 内容自动屏蔽

TOP

送花的学问 生活常识

提示: 作者被禁止或删除 内容自动屏蔽

TOP

侦探,毛刷

提示: 作者被禁止或删除 内容自动屏蔽

TOP

不错

提示: 作者被禁止或删除 内容自动屏蔽

TOP

runescape gold

They strive to offer the fastest and most reliable service on the web for all your gaming needs. Feel free to contact us 24 hours a day runescape gold, 7 days a week by phone, live chat and email. They work hard with their suppliers to offer the lowest prices they can. If you find a lower price somewhere please let them know and they will try their hardest to match it. The smoke Dungeon, located west of Pollnivneach, is a big part of the Desert Treasure Quest, and it is also a good place to train on Fire giants. There are lots of things within the Smoke Dungeon runescape money, but some are unknown. It is famous for being the home of the Dust Devils and is also home to one of the monsters you have to fight during the Desert Treasure Quest.As said in the first paragraph rs gold, there are things lurking in the depths of this dungeon that few know about. The things hidden within this dungeon are Fire Giants. Fire Giants are often killed in the Waterfall Dungeon which is normally very crowded, but within the depths of the Smoke Dungeon are several Fire Giants runescape gold. Four of these Giants are all in a room together which make it the best place to Melee Fire Giants outside the Wilderness.

TOP

?L俗

?L俗情報サイト「@?L俗」は成人向け?L俗情報(?L俗店、?L俗嬢、?L俗情報サイト、?L俗 系ランキングなど)をカテゴリ?eに掲?dするポータルサイトです

TOP

哇,好猛啊

哇,好猛啊


----------------------------------------------------------------------------------------------------------------------------
财务管理咨询 上海办公家具 童装批发 外贸童装 工业皮带

TOP

受教了

楼主的帖子 EVE ISK 让我受益匪浅,不知道楼主对我所喜欢的Dofus Kamasnexon cash maplestory mesos Anarchy Online Credits
[url=http://www.mmovp.combuy-maple-story-c-136.html]mesos[url]

TOP

发新话题