Meta的功能及应用
1 1. Meta的定义
Meta 描述网页数据的相关信息,例如主题、关键词、更新频率等等,meta存在于HTML中的head中,其本身并不会显示给用户,其作用主要是提示浏览器或者搜索引擎关于当前网页的一些重要信息。
2 2.重要的Meta功能及应用
2.1 webpage所使用的字符集提示信息
<meta http-equiv=”content-type” content=”text/html;charset=utf-8”>
2.2 禁止搜索引擎的排名或者基于当前网页的链接
<meta name=”robots” content=”noindex,nofollow”>----适用于所有的搜索引擎
<meta name=”googlebot” content=”…”>----只适用于google
相关的参数还包括如下:
- noindex: prevents the page from being indexed
- nofollow: prevents the Googlebot from following links from this page
- nosnippet: prevents a snippet from being shown in the search results
- noodp: prevents the alternative description from the ODP/DMOZ from being used
- noarchive: prevents Google from showing the Cached link for a page.
- unavailable_after:[date]: lets you specify the exact time and date you want to stop crawling and indexing of this page
- nop_w_picpathindex: lets you specify that you do not want your page to appear as the referring page for an p_w_picpath that appears in Google search results.
2.3 禁止网页脱机浏览
<meta http-equiv=”Pragma” Content=”No-cach”>
2.4 搜索引擎的关键词定义
<meta name=”keywords” content=”新闻,国内新闻,国际新闻”>
2.5 网页主题或者内容描述
< meta name="description" content=”Awesome Description Here”>
2.6 提示google不需要翻译过的网页服务
<meta name=”google” content=”nontranslate”>
2.7 防止google仍然使用网页上的旧的描述
<meta name=”googlebot” content=”code”>
<meta name=”googlebot” content=”noodp”>---告诉google使用你的网页当前的描述;
2.8 定义网页的默认脚本/CSS语言
<
meta
http-equiv="Content-Script-Type" content="text/javascript">
<
meta
http-equiv="Content-Style-Type" content="text/css">
3 3. Meta与HTTP协议的关系
<meta />提供的信息在浏览器看来如同收到了HTTP header信息;因为HTTP header也是关于某个HTML document的描述性信息,在浏览器中也是不显示的,只是相关提示信息;
在server这一端,只是对<meta name=””>信息会放到HTTP header中,一般不处理<meta http-equiv=””>.
Reference
[1] http://www.metatags.org/all_metatags
各种meta tag的定义及相关解释
[2] http://searchenginewatch.com/article/2067564/How-To-Use-HTML-Meta-Tags
如何使用meta tag.
[3] http://support.google.com/webmasters/bin/answer.py?hl=en&answer=79812
Google上关于meta tag的介绍
[4] http://www.htmlcodetutorial.com/document/index_tagsupp_13.html
Meta与HTTP header的关系