Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

hCard

From Wikipedia, the free encyclopedia
Standard for publishing contact details in web pages

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

It allows parsing tools (for example other websites, orFirefox'sOperator extension) to extract the details, and display them, using some other websites ormapping 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 andhReview andhProduct microformats, and using them to populate search-result pages.[2] In September 2010Google 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

[edit]

Consider the HTML:

<ul><li>JosephDoe</li><li>Joe</li><li>TheExampleCompany</li><li>604-555-1234</li><li><ahref="http://example.com/">http://example.com/</a></li></ul>

With microformat markup, that becomes:

<ulclass="vcard"><liclass="fn">JosephDoe</li><liclass="nickname">Joe</li><liclass="org">TheExampleCompany</li><liclass="tel">604-555-1234</li><li><aclass="url"href="http://example.com/">http://example.com/</a></li></ul>

A profile may optionally be included in the page header:

<linkrel="profile"href="http://microformats.org/profile/hcard">

Here the propertiesfn,[5]nickname,org (organization),tel (telephone number) andurl (web address) have been identified using specific class names; and the whole thing is wrapped inclass="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, thefn andorg classes are used on the same element, as in<span>Wikipedia</span> or<span>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

[edit]

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

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

Live example

[edit]

Here are theWikimedia Foundation's contact details as of February 2023[update], as a live hCard:

Wikimedia Foundation, Inc.
1 Montgomery Street, Suite 1600
San Francisco,CA94104

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

<divclass="vcard"><divclass="fn org">WikimediaFoundationInc.</div><divclass="adr"><divclass="street-address">1MontgomeryStreet,Suite1600</div><div><spanclass="locality">SanFrancisco</span>,<abbrclass="region"title="California">CA</abbr><spanclass="postal-code">94104</span></div><divclass="country-name">USA</div></div><div>Phone:<spanclass="tel">+1-415-839-6885</span></div><div>Email:<spanclass="email">info@wikimedia.org</span></div><divclass="tel"><spanclass="type">Fax</span>:<spanclass="value">+1-415-882-0495</span></div></div>

In this example, thefn andorg properties are combined on one element, indicating that this is the hCard for an organization, not a person.

Other attributes

[edit]

Other commonly used hCard attributes include

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

See also

[edit]

References

[edit]
  1. ^Sikos, Leslie (2011).Web Standards: Mastering HTML5, CSS3, and XML. Apress.ISBN 978-1430240419. Retrieved2013-05-10.
  2. ^Goel, Kavi; Guha, Ramanathan V.; Hansson, Othar (2009-05-12)."Introducing Rich Snippets".Google Webmaster Central Blog. Retrieved2009-05-25.
  3. ^Blumenthal, Mike (2010-09-22)."Google Announces Full Support for Microformats in Local".Understanding Google Maps. Retrieved2010-09-30.
  4. ^Protalinski, Emil (2011-02-18)."Facebook adds hCalendar and hCard microformats to Events". ZDNet. Archived fromthe original on February 19, 2011. Retrieved24 March 2011.
  5. ^no friendly name defined in the specificationhttp://microformats.org/wiki/hcard#Property_List, but one might think of it as "full name", "formal name", "formatted name", or "family name"

Further reading

[edit]


Background
Sub-topics
Applications
Related topics
Standards
Syntax and supporting technologies
Schemas, ontologies and rules
Semantic annotation
Common vocabularies
Microformat vocabularies
Retrieved from "https://en.wikipedia.org/w/index.php?title=HCard&oldid=1279008470"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp