HTML Meta标签知多少

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML Meta标签知多少相关的知识,希望对你有一定的参考价值。

一、基本属性

标签常常被用来定义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标签
01
<!-- SEO -->
02
<meta name="keywords" content="your, tags"/>
03
<meta name="description" content="150 words"/>
04
<meta name="subject" content="your website\'s subject">
05
<meta name="copyright"content="company name">
06

07
<meta name="language" content="ES">
08
<meta name="robots" content="index,follow" />
09
<meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm" />
10
<meta name="abstract" content="">
11
<meta name="topic" content="">
12
<meta name="summary" content="">
13
<meta name="Classification" content="Business">
14
<meta name="author" content="name, email@hotmail.com">
15
<meta name="designer" content="">
16
<meta name="copyright" content="">
17
<meta name="reply-to" content="email@hotmail.com">
18
<meta name="owner" content="">
19
<meta name="url" content="http://www.websiteaddrress.com">
20
<meta name="identifier-URL" content="http://www.websiteaddress.com">
21
<meta name="directory" content="submission">
22
<meta name="category" content="">
23
<meta name="coverage" content="Worldwide">
24
<meta name="distribution" content="Global">
25
<meta name="rating" content="General">
26
<meta name="revisit-after" content="7 days">
27

28
<meta http-equiv="Expires" content="0">
29
<meta http-equiv="Pragma" content="no-cache">
30
<meta http-equiv="Cache-Control" content="no-cache">
三、OpenGraph Meta标签

为了提高站外内容的传播效率,2010年9月,在F8会议上Facebook公布了一套开放图景协议(Open Graph Protocol),任何网页只要遵守该协议,SNS就能从页面上提取最有效的信息并呈现给用户。通过Open Graph把其他社交网站建构的网络给连接起来,将创造一个更聪明、更与社交连接、更个人化也更具语意意识的网络。
01
<meta name="og:title" content="The Rock"/>
02
<meta name="og:type" content="movie"/>
03
<meta name="og:url" content="http://www.imdb.com/title/tt0117500/"/>
04
<meta name="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
05
<meta name="og:site_name" content="IMDb"/>
06
<meta name="og:description" content="A group of U.S. Marines, under command of..."/>
07

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

10
<meta name="og:email" content="me@example.com"/>
11
<meta name="og:phone_number" content="650-123-4567"/>
12
<meta name="og:fax_number" content="+1-415-123-4567"/>
13

14
<meta name="og:latitude" content="37.416343"/>
15
<meta name="og:longitude" content="-122.153013"/>
16
<meta name="og:street-address" content="1601 S California Ave"/>
17
<meta name="og:locality" content="Palo Alto"/>
18
<meta name="og:region" content="CA"/>
19
<meta name="og:postal-code" content="94304"/>
20
<meta name="og:country-name" content="USA"/>
21

22
<meta property="og:type" content="game.achievement"/>
23
<meta property="og:points" content="POINTS_FOR_ACHIEVEMENT"/>
24

25
<meta property="og:video" content="http://example.com/awesome.swf" />
26
<meta property="og:video:height" content="640" />
27
<meta property="og:video:width" content="385" />
28
<meta property="og:video:type" content="application/x-shockwave-flash" />
29
<meta property="og:video" content="http://example.com/html5.mp4" />
30
<meta property="og:video:type" content="video/mp4" />
31
<meta property="og:video" content="http://example.com/fallback.vid" />
32
<meta property="og:video:type" content="text/html" />
33

34
<meta property="og:audio" content="http://example.com/amazing.mp3" />
35
<meta property="og:audio:title" content="Amazing Song" />
36
<meta property="og:audio:artist" content="Amazing Band" />
37
<meta property="og:audio:album" content="Amazing Album" />
38
<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
01
<!-- 从桌面icon启动ios Safari是否进入全屏状态(APP模式) -->
02
<meta name="apple-mobile-web-app-capable" content="yes">
03

04
<!-- 添加到主屏幕“后,全屏显示 -->
05
<meta name="apple-touch-fullscreen" content="yes" >
06

07
<!-- 指定状态栏的颜色 -->
08
<meta name="apple-mobile-web-app-status-bar-style" content="black">
09

10
<!-- ios设备上禁止将数字识别为可点击的telephone link -->
11
<meta name="format-detection" content="telephone=no">
12

13
<!-- 页面CSS计算时使用宽度为320,初始缩放比例2.3, 不允许用户缩放, 最大缩放因子为1 -->
14
<meta name="viewport" content="width = 320, initial-scale = 2.3, user-scalable = no, maximum-scale=1 ">
15

16
<!-- 页面CSS计算时使用的宽度根据设备给定值自适应 -->
17
<meta name= "viewport" content = "width = device-width">

4.3 INTERNET EXPLORER META TAGS
01
<meta http-equiv="Page-Enter" content="RevealTrans(Duration=2.0,Transition=2)" />
02
<meta http-equiv="Page-Exit" content="RevealTrans(Duration=3.0,Transition=12)" />
03
<meta name="mssmarttagspreventparsing" content="true">
04

05
<!-- 告诉IE浏览器以什么模式展示网页 -->
06
<meta http-equiv="X-UA-Compatible" content="chrome=1">
07

08
<meta name="msapplication-starturl" content="http://blog.reybango.com/about/"/>
09
<meta name="msapplication-window" content="width=800;height=600"/>
10
<meta name="msapplication-navbutton-color" content="red"/>
11
<meta name="application-name" content="Rey Bango Front-end Developer"/>
12
<meta name="msapplication-tooltip" content="Launch Rey Bango\'s Blog"/>
13
<meta name="msapplication-task" content="name=About;action-uri=/about/;icon-uri=/images/about.ico" />
14
<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" />
15
<meta name="msapplication-task" content="name=jQuery Posts;action-uri=/category/jquery/;icon-uri=/images/jquery.ico" />
16
<meta name="msapplication-task" content="name=Start Developing;action-uri=/category/javascript/;icon-uri=/images/script.ico" />
17

18
<!-- Tab标签icon -->
19
<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
<meta name="csrf-param" content="authenticity_token"/>
2
<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
<meta name="google-analytics" content="1-AHFKALJ"/>
2
<meta name="disqus" content="EEEE"/>
3
<meta name="uservoice" content="XXXX"/>
4
<meta name="mixpanel" content="XXXXE"/>
参考技术A <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="网页描述" /> <meta name="keywords" content="关键词" /> 常用的META标签就这三个,当然还有很多,这三个是基本的。第一行标明网页是UTF-8格式 第二行意思是网页的描述。 第三行意思是网页关键词,多用于SEO,写入合适的关键词方便搜索引擎找到。 参考技术B 你可以在网上搜索。
meta里面都是一些说明内容。
所以网上有很全的东西。

以上是关于HTML Meta标签知多少的主要内容,如果未能解决你的问题,请参考以下文章

html的meta总结,html标签中meta属性使用介绍

HTML--meta标签

如何理解meta标签

meta标签 bead标签

HTML Meta标签

html的meta总结,html标签中meta属性使用介绍