你需要知道的 HTML <META>

来源:互联网 发布:spark大数据分析 pdf 编辑:程序博客网 时间:2024/05/25 05:35

META 是 HTML 语言 <head></head> 区的一个辅助性标签。几乎所有的网页源代码里,我们可以看到它的影子。

如果你是网站的访问者,这些代码对你来说,可有可无;但如果你是开发者或者运营者,你一定要了解它。如果你能够用好 meta 标签,会给你带来意想不到的效果。

<meta> 标签位于文档的头部,不包含任何可见的内容。
<meta> 标签的属性定义了与文档相关联的名称/值对。
<meta> 标签共有两个属性,它们分别是 http-equiv 属性和 name 属性,不同的属性又有不同的参数值,这些不同的参数值就实现了不同的网页功能。

更多它的具体描述,请参考 W3C HTML Element META 或 W3C HTML ELement Meta

我们今天,主要是向大家罗列一下当前所有已知的 <meta> 和 <link> 的用法

基本 HTML Meta 标签

  • 声明文档使用的字符编码是 UTF-8
    1. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    HTML5 中简化为

    1. <meta charset='utf-8'>
  • 使用关键词描述一个网页的属性,SEO 必选
    1. <meta name="keywords" content="your, tags" />
  • 使用一段自然语言描述一个网页的属性,SEO 必选
    1. <meta name="description" content="150 words" />
  • 其他
    1. <meta name="subject" content="your website" />
    2. <meta name="copyright" content="company name" />
    3. <meta name="language" content="ES" />
    4. <meta name="robots" content="index,follow" />
    5. <meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm" />
    6. <meta name="abstract" content="" />
    7. <meta name="topic" content="" />
    8. <meta name="summary" content="" />
    9. <meta name="Classification" content="Business" />
    10. <meta name="author" content="name, email@hotmail.com" />
    11. <meta name="designer" content="" />
    12. <meta name="reply-to" content="email@hotmail.com" />
    13. <meta name="owner" content="" />
    14. <meta name="url" content="http://www.websiteaddrress.com" />
    15. <meta name="identifier-URL" content="http://www.websiteaddress.com" />
    16. <meta name="directory" content="submission" />
    17. <meta name="pagename" content="jQuery Tools, Tutorials and Resources - O" />
    18. <meta name="category" content="" />
    19. <meta name="coverage" content="Worldwide" />
    20. <meta name="distribution" content="Global" />
    21. <meta name="rating" content="General" />
    22. <meta name="revisit-after" content="7 days" />
    23. <meta name="subtitle" content="This is my subtitle" />
    24. <meta name="target" content="all" />
    25. <meta name="HandheldFriendly" content="True" />
    26. <meta name="MobileOptimized" content="320" />
    27. <meta name="date" content="Sep. 27, 2010" />
    28. <meta name="search_date" content="2010-09-27" />
    29. <meta name="DC.title" content="Unstoppable Robot Ninja" />
    30. <meta name="ResourceLoaderDynamicStyles" content="" />
    31. <meta name="medium" content="blog" />
    32. <meta name="syndication-source" content="https://mashable.com/2008/12/24/free-brand-monitoring-tools/" />
    33. <meta name="original-source" content="https://mashable.com/2008/12/24/free-brand-monitoring-tools/" />
    34. <meta name="verify-v1" content="dV1r/ZJJdDEI++fKJ6iDEl6o+TMNtSu0kv18ONeqM0I=" />
    35. <meta name="y_key" content="1e39c508e0d87750" />
    36. <meta name="pageKey" content="guest-home" />
    37. <meta name="itemprop" content="jQTouch" />
    38. <meta http-equiv="Expires" content="0" />
    39. <meta http-equiv="Pragma" content="no-cache" />
    40. <meta http-equiv="Cache-Control" content="no-cache" />
    41. <meta http-equiv="imagetoolbar" content="no" />
    42. <meta http-equiv="x-dns-prefetch-control" content="off" />

OpenGraph Meta Tags

  1. <meta name="og:title" content="The Rock" />
  2. <meta name="og:type" content="movie" />
  3. <meta name="og:url" content="http://www.imdb.com/title/tt0117500/" />
  4. <meta property="og:audio" content="http://example.com/bond/theme.mp3" />
  5. <meta property="og:audio:secure_url" content="https://secure.example.com/sound.mp3" />
  6. <meta property="og:audio:type" content="audio/mpeg" />
  7. <meta property="og:description" content="Sean Connery found fame and fortune as the suave, sophisticated British agent, James Bond." />
  8. <meta property="og:determiner" content="the" />
  9. <meta property="og:locale" content="en_GB" />
  10. <meta property="og:locale:alternate" content="fr_FR" />
  11. <meta property="og:locale:alternate" content="es_ES" />
  12. <meta property="og:site_name" content="IMDb" />
  13. <meta property="og:image" content="http://example.com/ogp.jpg" />
  14. <meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
  15. <meta property="og:image:type" content="image/jpeg" />
  16. <meta property="og:image:width" content="400" />
  17. <meta property="og:image:height" content="300" />
  18. <meta property="og:video" content="http://example.com/movie.swf" />
  19. <meta property="og:video:secure_url" content="https://secure.example.com/movie.swf" />
  20. <meta property="og:video:type" content="application/x-shockwave-flash" />
  21. <meta property="og:video:width" content="400" />
  22. <meta property="og:video:height" content="300" />
  23. <meta name="twitter:card" content="summary">
  24. <meta name="twitter:site" content="@nytimes">
  25. <meta name="twitter:creator" content="@SarahMaslinNir">
  26. <meta name="twitter:url" content="http://www.nytimes.com/2012/02/19/arts/music/amid-police-presence-fans-congregate-for-whitney-houstons-funeral-in-newark.html">
  27. <meta name="twitter:title" content="Parade of Fans for Houston’s Funeral">
  28. <meta name="twitter:description" content="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here.">
  29. <meta name="twitter:image" content="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg">
  30. <meta name="weibo:article:create_at" content="2013-03-29 16:34:33 +0800" />
  31. <meta name="weibo:article:update_at" content="2013-03-29 16:49:54 +0800" />

更多 OpenGraph META 请点击这里这里(需翻墙)、Twitter Card(需翻墙)

自定义 Meta 标签

  1. <meta name="google-analytics" content="1-AHFKALJ" />
  2. <meta name="disqus" content="abcdefg" />
  3. <meta name="uservoice" content="asdfasdf" />
  4. <meta name="mixpanel" content="asdfasdf" />

公司/服务 Meta 标签

  1. <meta name="microid" content="mailto+http:sha1:e6058ed7fca4a1921cq91d7f1f3b8736cd3cc1g7" />
  2. <meta name="readability-verification" content="E7aEHvVQpWc8VHDqKvaB2Z58hek2EAv2HuLuegv7" />
  3. <meta name="google-site-verification" content="4SMIedO1X4IkYrYuhEC2VuovdQM36Xxb0btUjElqQyg" />
  4. <meta name="ICBM" content="40.746990, -73.980537" />
  5. <meta name="generator" content="WordPress 3.3.1" />
  6. <meta name="norton-safeweb-site-verification" content="tz8iotmk-pkhui406y41y5bfmfxdwmaa4a-yc0hm6r0fga7s6j0j27qmgqkmc7oovihzghbzhbdjk-uiyrz438nxsjdbj3fggwgl8oq2nf4ko8gi7j4z7t78kegbidl4" />

苹果设备 Meta 标签

  1. <meta name="apple-mobile-web-app-title" content="My App" /><!-- New in iOS6 -->
  2. <meta name="apple-mobile-web-app-capable" content="yes" />
  3. <meta name="apple-touch-fullscreen" content="yes" />
  4. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  5. <meta name="format-detection" content="telephone=no" />
  6. <meta name="viewport" content="width=device-width; content=" />
  7. <link href="/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" />
  8. <link href="touch-icon-ipad.png" rel="apple-touch-icon" sizes="72x72" />
  9. <link href="touch-icon-iphone4.png" rel="apple-touch-icon" sizes="114x114" />
  10. <link href="/startup.png" rel="apple-touch-startup-image" />
  11. <link href="http://github.com/images/touch-icon-iphone4.png" rel="apple-touch-icon-precomposed" sizes="114x114" />
  12. <link href="http://github.com/images/touch-icon-ipad.png" rel="apple-touch-icon-precomposed" sizes="72x72" /> <link href="http://github.com/images/apple-touch-icon-57x57.png" rel="apple-touch-icon-precomposed" sizes="57x57" />

Internet Explorer Meta 标签

  1. <meta name="msapplication-TileImage" content="images/benthepcguy-144.png"/><!-- Windows 8 -->
  2. <meta name="msapplication-TileColor" content="#d83434"/><!-- Windows 8 -->
  3. <meta http-equiv="MSThemeCompatible" content="No"/>
  4. <meta http-equiv="Page-Enter" content="RevealTrans(Duration=2.0,Transition=2)" />
  5. <meta http-equiv="Page-Exit" content="RevealTrans(Duration=3.0,Transition=12)" />
  6. <meta name="mssmarttagspreventparsing" content="true" />
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  8. <meta name="msapplication-starturl" content="http://blog.reybango.com/about/" />
  9. <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" />
  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. <meta name="msvalidate.01" content="6E3AD52DC176461A3C81DD6E98003BC9" />
  18. <meta http-equiv="cleartype" content="on" />

TweetMeme Meta 标签

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

博客分类 Meta 标签

  1. <meta name="blogcatalog" />

Rails Meta 标签

  1. <meta name="csrf-param" content="authenticity_token" />
  2. <meta name="csrf-token" content="/bZVwvomkAnwAI1Qd37lFeewvpOIiackk9121fFwWwc=" />

HTML Link 标签

  1. <link title="RSS" href="http://feeds.feedburner.com/martini" rel="alternate" type="application/rss+xml" />
  2. <link title="Atom 0.3" href="https://example.com/feed.atom" rel="alternate" type="application/atom+xml" /> <link href="/favicon.ico" rel="shortcut icon" type="image/ico" />
  3. <link href="/fluid-icon.png" rel="fluid-icon" type="image/png" />
  4. <link href="http://google.com/profiles/thenextweb" rel="me" type="text/html" />
  5. <link href="http://blog.unto.net/?p=353" rel="shortlink" />
  6. <link title="May 2003" href="http://blog.unto.net/2003/05/" rel="archives" />
  7. <link title="DeWitt Clinton" href="http://blog.unto.net/" rel="index" />
  8. <link title="Pattern Recognition 1" href="http://blog.unto.net/photos/pattern_recognition_1_about/" rel="start" />
  9. <link title="Styleguide" href="http://paulrobertlloyd.com/about/styleguide/" rel="bookmark" />
  10. <link title="Viatropos" href="/search.xml" rel="search" type="application/opensearchdescription+xml" />
  11. <link href="http://www.syfyportal.com/atomFeed.php?page=3" rel="self" type="application/atom+xml" />
  12. <link href="http://www.syfyportal.com/atomFeed.php" rel="first" />
  13. <link href="http://www.syfyportal.com/atomFeed.php?page=4" rel="next" />
  14. <link href="http://www.syfyportal.com/atomFeed.php?page=2" rel="previous" />
  15. <link href="http://www.syfyportal.com/atomFeed.php?page=147" rel="last" />
  16. <link href="http://smallbiztrends.com/2010/06/9-things-to-do-before-entering-social-media.html" rel="canonical" />
  17. <link title="RSD" href="http://smallbiztrends.com/xmlrpc.php?rsd" rel="EditURI" type="application/rsd+xml" />
  18. <link href="http://smallbiztrends.com/xmlrpc.php" rel="pingback" />
  19. <link href="http://wordpress.org/style/iphone.css" rel="stylesheet" media="only screen and (max-device-width: 480px)" type="text/css" />
  20. <link href="http://www.example.com/wp-includes/wlwmanifest.xml" rel="wlwmanifest" type="application/wlwmanifest+xml" />
  21. <link title="FAQ" href="/faq" rel="help" />
  22. <link href="https://playfoursquare.s3.amazonaws.com/press/logo/foursquare-logo.svg" rel="logo" type="image/svg" />
  23. <link href="/w3c/p3p.xml" rel="P3Pv1" />
  24. <link href="https://plus.google.com/115081025762845243709/" rel="publisher" />
  25. <link href="http://du3itj18e4z0b.cloudfront.net/7b29fe/images/icon-facebook.gif" rel="image_src" type="image/jpeg" />
  26. <link href="humans.txt" rel="author" type="text/plain" />
  27. <link href="http://thenextweb.com/2009/01/08/how-to-snap-up-that-twitter-username-youve-always-wanted/" rel="original-source" />
  28. <link title="Microformats" href="http://microformats.org/profile/specs/" rel="profile" />
  29. <link href="http://gmpg.org/xfn/11" rel="profile" />
  30. <link href="https://chrome.google.com/webstore/detail/noojglkidnpfjbincgijbaiedldjfbhh" rel="chrome-webstore-item" />

其它资源

- HTML5 Boilerplate explanations and suggestions of header tags
- Dublic Core Meta Tags
- Apple Meta Tags
- OpenGraph Meta Tags
- Link Tag Meaning
- Google Chrome HTML5 Tags

本文原文:Complete list of HTML META tags

0 0
原创粉丝点击