请输入您要查询的百科知识:

 

词条 HCard
释义

  1. Example

  2. Geo and adr

  3. Live example

  4. Other attributes

  5. See also

  6. References

  7. External links

{{short description|Standard for publishing contact details in web pages}}{{selfref|For details of hCard use on Wikipedia, see Microformats.}}{{lowercase|title=hCard}}

hCard is a microformat for publishing the contact details (which might be no more than the name) of people, companies, organizations, and places, in (X)HTML, Atom, RSS, or arbitrary XML.[1] The hCard microformat does this using a 1:1 representation of vCard (RFC 2426) properties and values, identified using HTML classes and rel attributes.

It allows parsing tools (for example other websites, or Firefox's Operator extension) to extract the details, and display them, using some other websites or mapping tools, index or search them, or to load them into an address-book program.

In May 2009, Google announced that they would be parsing the hCard, hReview and hProduct microformats, and using them to populate search-result pages.[2] In September 2010 Google announced their intention to surface hCard, hReview information in their local search results.[3] In February 2011, Facebook began using hCard to mark up event venues.[4]

Example

Consider the HTML:

  • Joe Doe
  • Jo
  • The Example Company
  • 604-555-1234
  • http://example.com/

With microformat markup, that becomes:

...

...

  • Joe Doe
  • Jo
  • The Example Company
  • 604-555-1234
  • http://example.com/

Here the properties fn,[5] org (organization), tel (telephone number) and url (web address) have been identified using specific class names; and the whole thing is wrapped in class="vcard" which indicates that the other classes form an hcard, and are not just coincidentally named. If the hCard is for an organization or venue, the fn and org classes are used on the same element, as in <span class="fn org">Wikipedia</span> or <span class="fn org">Wembley Stadium</span>. Other, optional, hCard classes also exist.

It is now possible for software, for example browser plug-ins, to extract the information, and transfer it to other applications, such as an address book.

Geo and adr

The Geo microformat is a part of the hCard specification, and is often used to include the coordinates of a location within an hCard.

The adr part of hCard can also be used as a stand-alone microformat.

Live example

{{update after|2017|10|01|reason=The Wikimedia foundation is moving. See https://wikimediafoundation.org/wiki/Contact_us}}

Here are the Wikimedia Foundation's contact details as of September 2017, as a live hCard:

Wikimedia Foundation Inc.
149 New Montgomery Street, 3rd Floor
San Francisco, CA 94105
USA
Phone: +1-415-839-6885
Email:
Fax: +1-415-882-0495

The mark-up (wrapped for clarity) used is:

Wikimedia Foundation Inc.
149 New Montgomery Street, 3rd Floor
San Francisco, CA 94105
USA
Phone: +1-415-839-6885
Email:

Fax:

+1-415-882-0495

Note that, in this example, the fn and org properties are combined on one element, indicating that this is the hCard for an organization, not a person.

Other attributes

Other commonly used hCard attributes include

  • bday - a person's birth date
  • email
  • honorific-prefix
  • honorific-suffix
  • label - for non-granular addresses
  • logo
  • nickname
  • note - free text
  • photo
  • post-office-box

See also

  • vCard
  • XHTML Friends Network

References

1. ^{{cite book | last1 = Sikos | first1 = Leslie | title = Web Standards: Mastering HTML5, CSS3, and XML | publisher = Apress | year = 2011 | url = https://books.google.com/books?id=c4_wQQ1iajgC&dq | accessdate = 2013-05-10 | isbn = 978-1430240419}}
2. ^{{cite web|url=http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snippets.html|title=Introducing Rich Snippets|last=Goel|first=Kavi|first2=Ramanathan V.|last2=Guha|first3=Othar|last3=Hansson|date=2009-05-12|work=Google Webmaster Central Blog|publisher=Google|accessdate=2009-05-25}}
3. ^{{cite web|url=http://blumenthals.com/blog/2010/09/22/google-announces-full-support-for-microformats-in-local/|title=Google Announces Full Support for Microformats in Local|last=Blumenthal|first=Mike|date=2010-09-22|work=Understanding Google Maps|accessdate=2010-09-30}}
4. ^{{cite web|url=http://www.zdnet.com/blog/facebook/facebook-adds-hcalendar-and-hcard-microformats-to-events/266|title=Facebook adds hCalendar and hCard microformats to Events|last=Protalinski|first=Emil|date=2011-02-18|publisher=ZDNet|accessdate=24 March 2011}}
5. ^no friendly name defined in the specification http://microformats.org/wiki/hcard#Property_List, but one might think of it as "formal name", "formatted name", or "family name"
  • {{cite book |title=Microformats: Empowering Your Markup for Web 2.0 |last=Allsopp |first=John |authorlink= |coauthors= |year=2007 |publisher=Friendsof |location=Berkeley |isbn=1-59059-814-8 |page=125 }}

External links

  • hCard spec on microformats.org
  • hCard cheat-sheet
{{Semantic Web}}{{DEFAULTSORT:Hcard}}

2 : Microformats|Business cards

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 20:37:07