HTML Meta标签知多少

文章已同步至个人Blog:Benjamin - 专注前端开发和用户体验

一、基本属性

标签常常被用来定义HTML文档的元数据或者HTTP协议的指向,这些元数据常用在SEO、HTML Pages or Apps on Mobile/Handheld Devices,该标签主要包括以下属性:

Attribute Description
Name Name for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc.
content Specifies the property‘s value.
scheme Specifies a scheme to interpret the property‘s value (as declared in the content attribute).
http-equiv Used for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.

二、基本的HTML Meta标签

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

<!-- SEO -->

<meta name="keywords" content="your, tags"/>

<meta name="description" content="150 words"/>

<meta name="subject" content="your website‘s subject">

<meta name="copyright"content="company name">

<meta name="language" content="ES">

<meta name="robots" content="index,follow" />

<meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm" />

<meta name="abstract" content="">

<meta name="topic" content="">

<meta name="summary" content="">

<meta name="Classification" content="Business">

<meta name="author" content="name, [email protected]">

<meta name="designer" content="">

<meta name="copyright" content="">

<meta name="reply-to" content="[email protected]">

<meta name="owner" content="">

<meta name="url" content="http://www.websiteaddrress.com">

<meta name="identifier-URL" content="http://www.websiteaddress.com">

<meta name="directory" content="submission">

<meta name="category" content="">

<meta name="coverage" content="Worldwide">

<meta name="distribution" content="Global">

<meta name="rating" content="General">

<meta name="revisit-after" content="7 days">

<meta http-equiv="Expires" content="0">

<meta http-equiv="Pragma" content="no-cache">

<meta http-equiv="Cache-Control" content="no-cache">

三、OpenGraph Meta标签

为了提高站外内容的传播效率,2010年9月,在F8会议上Facebook公布了一套开放图景协议(Open Graph Protocol),任何网页只要遵守该协议,SNS就能从页面上提取最有效的信息并呈现给用户。通过Open Graph把其他社交网站建构的网络给连接起来,将创造一个更聪明、更与社交连接、更个人化也更具语意意识的网络。

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

<meta name="og:title" content="The Rock"/>

<meta name="og:type" content="movie"/>

<meta name="og:url" content="http://www.imdb.com/title/tt0117500/"/>

<meta name="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

<meta name="og:site_name" content="IMDb"/>

<meta name="og:description" content="A group of U.S. Marines, under command of..."/>

<meta name="fb:page_id" content="43929265776" />

<meta name="og:email" content="[email protected]"/>

<meta name="og:phone_number" content="650-123-4567"/>

<meta name="og:fax_number" content="+1-415-123-4567"/>

<meta name="og:latitude" content="37.416343"/>

<meta name="og:longitude" content="-122.153013"/>

<meta name="og:street-address" content="1601 S California Ave"/>

<meta name="og:locality" content="Palo Alto"/>

<meta name="og:region" content="CA"/>

<meta name="og:postal-code" content="94304"/>

<meta name="og:country-name" content="USA"/>

<meta property="og:type" content="game.achievement"/>

<meta property="og:points" content="POINTS_FOR_ACHIEVEMENT"/>

<meta property="og:video" content="http://example.com/awesome.swf" />

<meta property="og:video:height" content="640" />

<meta property="og:video:width" content="385" />

<meta property="og:video:type" content="application/x-shockwave-flash" />

<meta property="og:video" content="http://example.com/html5.mp4" />

<meta property="og:video:type" content="video/mp4" />

<meta property="og:video" content="http://example.com/fallback.vid" />

<meta property="og:video:type" content="text/html" />

<meta property="og:audio" content="http://example.com/amazing.mp3" />

<meta property="og:audio:title" content="Amazing Song" />

<meta property="og:audio:artist" content="Amazing Band" />

<meta property="og:audio:album" content="Amazing Album" />

<meta property="og:audio:type" content="application/mp3" />

四、公司/服务 Meta标签

4.1 CLAIMID

ClaimID was a website that allowed users to create unique profiles that showed personal websites, profiles at other sites, and other biographical information.

?


1

<meta name="microid" content="mailto+http:sha1:e6058ed7fca4a1921cq91d7f1f3b8736cd3cc1g7" />

4.2 APPLE META TAGS

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

<!-- 从桌面icon启动IOS Safari是否进入全屏状态(APP模式) -->

<meta name="apple-mobile-web-app-capable" content="yes">

<!-- 添加到主屏幕“后,全屏显示 -->

<meta name="apple-touch-fullscreen" content="yes" >

<!-- 指定状态栏的颜色 -->

<meta name="apple-mobile-web-app-status-bar-style" content="black">

<!-- ios设备上禁止将数字识别为可点击的telephone link -->

<meta name="format-detection" content="telephone=no">

<!-- 页面CSS计算时使用宽度为320,初始缩放比例2.3, 不允许用户缩放, 最大缩放因子为1 -->

<meta name="viewport" content="width = 320, initial-scale = 2.3, user-scalable = no, maximum-scale=1 ">

<!-- 页面CSS计算时使用的宽度根据设备给定值自适应 -->

<meta name= "viewport" content = "width = device-width">

4.3 INTERNET EXPLORER META TAGS

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

<meta http-equiv="Page-Enter" content="RevealTrans(Duration=2.0,Transition=2)" />

<meta http-equiv="Page-Exit" content="RevealTrans(Duration=3.0,Transition=12)" />

<meta name="mssmarttagspreventparsing" content="true">

<!-- 告诉IE浏览器以什么模式展示网页 -->

<meta http-equiv="X-UA-Compatible" content="chrome=1">

<meta name="msapplication-starturl" content="http://blog.reybango.com/about/"/>

<meta name="msapplication-window" content="width=800;height=600"/>

<meta name="msapplication-navbutton-color" content="red"/>

<meta name="application-name" content="Rey Bango Front-end Developer"/>

<meta name="msapplication-tooltip" content="Launch Rey Bango‘s Blog"/>

<meta name="msapplication-task" content="name=About;action-uri=/about/;icon-uri=/images/about.ico" />

<meta name="msapplication-task" content="name=The Big List;action-uri=/the-big-list-of-javascript-css-and-html-development-tools-libraries-projects-and-books/;icon-uri=/images/list_links.ico" />

<meta name="msapplication-task" content="name=jQuery Posts;action-uri=/category/jquery/;icon-uri=/images/jquery.ico" />

<meta name="msapplication-task" content="name=Start Developing;action-uri=/category/javascript/;icon-uri=/images/script.ico" />

<!-- Tab标签icon -->

<link rel="shortcut icon" href="/images/favicon.ico" />

4.4 TWEETMEME META TAGS

Tweetmeme跟踪Twitter上的链接,以给用户更好的体验。它使用一种常用的排序系统,以在这个微博世界里找出最热门的信息。

?


1

<meta name="tweetmeme-title" content="Retweet Button Explained" />

4.5 BLOG CATALOG META TAGS

?


1

<meta name="blogcatalog" />

4.6 RAILS META TAGS

?


1

2

<meta name="csrf-param" content="authenticity_token"/>

<meta name="csrf-token" content="/bZVwvomkAnwAI1Qd37lFeewvpOIiackk9121fFwWwc="/>

五、创建自定义 Meta标签

Use custom meta tags to store data that you need in javascript, instead of hard-coding that data into your javascript. I store my Google Analytics code in meta tags. Here‘s some examples:

?


1

2

3

4

<meta name="google-analytics" content="1-AHFKALJ"/>

<meta name="disqus" content="EEEE"/>

<meta name="uservoice" content="XXXX"/>

<meta name="mixpanel" content="XXXXE"/>

六、HTML Link 标签

6.1 HTML LINK TAGS

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/martini" />

<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />

<link rel="fluid-icon" type="image/png" href="/fluid-icon.png" />

<link rel="me" type="text/html" href="http://google.com/profiles/thenextweb"/>

<link rel=‘shortlink‘ href=http://blog.unto.net/?p=353 />

<link rel=‘archives‘ title=‘May 2003‘ href=http://blog.unto.net/2003/05/ />

<link rel=‘index‘ title=‘DeWitt Clinton‘ href=http://blog.unto.net/ />

<link rel=‘start‘ title=‘Pattern Recognition 1‘ href=http://blog.unto.net/photos/pattern_recognition_1_about/ />

<link rel=‘prev‘ title=‘OpenSearch and OpenID? A sure way to get my attention.‘ href=http://blog.unto.net/opensearch/opensearch-and-openid-a-sure-way-to-get-my-attention/ />

<link rel=‘next‘ title=‘Not blog‘ href=http://blog.unto.net/meta/not-blog/ />

<link rel="search" href="/search.xml" type="application/opensearchdescription+xml" title="Viatropos" />

<link rel="self" type="application/atom+xml" href="http://www.syfyportal.com/atomFeed.php?page=3"/>

<link rel="first" href="http://www.syfyportal.com/atomFeed.php"/>

<link rel="next" href="http://www.syfyportal.com/atomFeed.php?page=4"/>

<link rel="previous" href="http://www.syfyportal.com/atomFeed.php?page=2"/>

<link rel="last" href="http://www.syfyportal.com/atomFeed.php?page=147"/>

<link rel=‘shortlink‘ href=http://smallbiztrends.com/?p=43625 />

<link rel="canonical" href="http://smallbiztrends.com/2010/06/9-things-to-do-before-entering-social-media.html" />

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://smallbiztrends.com/xmlrpc.php?rsd" />

<link rel="pingback" href="http://smallbiztrends.com/xmlrpc.php" />

<link media="only screen and (max-device-width: 480px)" href="http://wordpress.org/style/iphone.css" type="text/css" rel="stylesheet" />

6.2 APPLE LINK TAGS

?


1

2

3

4

5

<link rel="apple-touch-icon" href="touch-icon-iphone.png" />

<link rel="apple-touch-icon" sizes="72x72" href="touch-icon-ipad.png" />

<link rel="apple-touch-icon" sizes="114x114" href="touch-icon-iphone4.png" />

<link rel="apple-touch-icon" type="image/png" href="/apple-touch-icon.png" />

<link rel="apple-touch-startup-image" href="/startup.png">

七、HTML5中的变化

The charset attribute specifies the character encoding used by the document. This is a character encoding declaration. If the attribute is present in an XML document, its value must be an ASCII case-insensitive match for the string "UTF-8" (and the document is therefore forced to use UTF-8 as its encoding).

The charset attribute on the meta element has no effect in XML documents, and is only allowed in order to facilitate migration to and from XHTML.

There must not be more than one meta element with a charset attribute per document.

八、参考链接

W3C HTML5 Meta Element

Metatags in HTML 5

HTML Meta Tags

COMPLETE LIST OF HTML META TAGS

DCMI Dublin Core Metadata Initiative

Apple-specific meta tags

LinkTagMeaning

Google Chrome HTML5 Tags

Facebook Open Graph META Tags

时间: 2024-12-29 07:05:01

HTML Meta标签知多少的相关文章

meta标签使用方法总结

meta标签是用来描述一个HTML网页文档的属性,比如该网页的作者,日期,网页的关键字,刷新,网页等级设定等等,是文档中的最基本的元信息,本文是对meta标签的学习总结,内容大多来自网上各个地方,非原创. 一个好的meta标签可以提高你的网站被搜索到的可能性,在搜索引擎优化方面需要好好利用meta标签的相关知识. meta标签可以分为两大部分: http-equiv: http标题信息 name:页面描述信息 http-equiv 类似于http的头部协议,作用是回应给浏览器一些有用的信息来帮助

[转]手机web HTML头信息解释和viewport meta标签解释

<meta charset="utf-8" /> <link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon" /> <meta name="Generator" content="LIXIPHP (http://lixiphp.com)" /> <met

移动平台对 META 标签的定义

下面介绍一些有关标记的例子及解释. 一.meta 标签分两大部分:HTTP 标题信息(http-equiv)和页面描述信息(name). 1.http-equiv 属性的 Content-Type 值(显示字符集的设定) 说明:设定页面使用的字符集,用以说明主页制作所使用的文字语言,浏览器会根据此来调用相应的字符集显示 page 内容. 用法: <meta http-equiv="Content-Type" content="text/html; charset=utf

HTML meta标签常用属性整理

概要 标签提供关于HTML文档的元数据.元数据不会显示在页面上,但是对于机器是可读的.它可用于浏览器(如何显示内容或重新加载页面),搜索引擎(关键词),或其他 web 服务. -- W3School 必要属性 属性 值 描述 content some text 定义与http-equiv或name属性相关的元信息 可选属性 属性 值 描述 http-equiv content-type / expire / refresh / set-cookie 把content属性关联到HTTP头部. na

HTML中&lt;meta&gt;标签的使用

HTML中<meta>标签的使用 <meta>标签基本介绍 <meta>标签是HTML网页源代码中一个重要的html标签.META便签用来描述一个HTML网页文档的属性,例如作者.日期.关键词.页面刷新.除此之外<meta>标签用于搜索引擎优化(SEO).它位于HTML文档中<head>元素内,虽然它提供的信息不可见,但它却是文档最基本的元信息. <meta>标签的属性列举 <meta>标签中属性可以分为必选属性和可选的属

meta标签常用属性整理

在segmentfault看到这篇文章,觉得整理的很详细,所以转载过来和大家分享一下.原文地址:http://segmentfault.com/blog/ciaocc/1190000002407912作者:ciaocc版权贵ciaocc所有,转载请注明版权. 概要 标签提供关于HTML文档的元数据.元数据不会显示在页面上,但是对于机器是可读的.它可用于浏览器(如何显示内容或重新加载页面),搜索引擎(关键词),或其他 web 服务. ——W3School 必要属性 属性 值 描述 content

Meta 标签详解

META标签是HTML语言HEAD区的一个辅助性标签,它位于HTML文档头部的标记和 标题 <<标记之间,它提供用户不可见的信息.meta标签通常用来为搜索引擎robots定义页面主题,或者是定义用户浏览器上的cookie:它可以用于鉴别作者,设定页面格式,标注内容提要和关键字:还可以设置页面使其可以根据你定义的时间间隔刷新自己,以及设置RASC内容等级,等等. 详细介绍 下面介绍一些有关 标记的例子及解释. META标签分两大部分:HTTP标题信息(HTTP-EQUIV)和页面描述信息(NA

移动web前端之meta标签

最近这段时间忙着做web移动端,东西跟pc端还是有区别的.这个月也学到了不少东西,太多了就从头开始,先总结meta标签吧. 主要标签内容和注释如下: <meta charset="UTF-8"> <!--html5 已经简化 设置charset字符编码的格式--> <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/> <!--使用

Html中meta标签详解--以前经常忽略的

W3School介绍:http://www.w3school.com.cn/html5/html5_meta.asp meta是用来在HTML文档中模拟HTTP协议的响应头报文. meta 标签的用处很多. meta 的属性有两种:name和http-equiv. name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找.分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类).这其中最重要的是description(站点在搜索引擎上的描述)和