网页 综合 更新时间 2026-11-13 20:17:55

hCard 1.0 - Microformats Wiki

自动蜘蛛 microformats.org 正文约 6000 字
Tantek Çelik (Editor, Author), Brian Suda (Author)
hCard is a simple, open format for publishing people, companies, organizations on the web, using a 1:1 representation of vCard (RFC2426) properties and values in HTML. hCard is one of several open microformat standards suitable for embedding data in HTML/HTML5, and Atom/RSS/XHTML or other XML.
Translations: Français • 日本語 • Русский • ภาษาไทย • 漢語 • (Add your language) Copyright and patents statements apply. See acknowledgments.
hCards are most often used to represent people:
Create a new hCard Learn hCard authoring
The class vcard is a root class name that indicates the presence of an hCard.
The classes url, fn, and org define properties of the hCard.
hCard 1.0 is a microformats.org specification. Public discussion on hCard takes place on hcard-feedback, the #microformats irc channel on irc.freenode.net, and microformats-discuss mailing list.
Known errors and issues in this specification are corrected in resolved and closed issues. Please check there before reporting issues.
The hCard 1.0.1 update is currently under development and incorporates known errata corrections as well as the value-class-pattern.
The vCard standard (RFC2426), has been broadly interoperably implemented (e.g. Apple's "Address Book" application built into MacOSX).
In addition, many bloggers identify themselves by name and discuss their friends and family. With just a tad bit of structure, bloggers can discuss people in their blog(s) in such a way that spiders and other aggregators can retrieve this information, automatically convert them to vCards, and use them in any vCard application or service.
This specification introduces the hCard format, which uses a 1:1 representation of the properties and values of the aforementioned vCard standard, in semantic HTML. Bloggers can both embed hCards directly in their web pages, and style them with CSS to make them appear as desired. In addition, hCard enables applications to retrieve information directly from web pages without having to reference a separate file.
Use the hCard creator and copy the HTML code it generates to your blog or website to publish your contact info.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
The vCard standard (RFC2426) forms the basis of hCard.
The basic format of hCard is to use vCard object/property names in lower-case for class names, and to map the nesting of vCard objects directly into nested HTML elements.
The root class name for an hCard is "vcard". An element with a class name of "vcard" is itself called an hCard.
The properties of an hCard are represented by elements inside the hCard. Elements with class names of the listed properties represent the values of those properties. Some properties have sub-properties, and those are represented by elements inside the elements for properties.
hCard properties (sub-properties in parentheses like this)
1. ^: The 'n' property is OPTIONAL if any implied 'n' optimization rules are in effect. 2. ^: tel - Authors MAY follow the E.123 standard for writing values of telephone numbers. Letter values (e.g. +1-555-FORMATS) MUST be converted to numbers. Use an abbr to display letters and provide a numerical value simultaneously, e.g. <abbr title="+15553676287">+1-555-FORMATS</abbr>. 3. ^: tz - timezones are indicated with the timezone offset, e.g. PST (<span class="tz">-08:00</span>).
Singular properties: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class', 'rev'. For properties which are singular, the first descendant element with that class SHOULD take effect, any others being ignored.
All other properties MAY be plural. Each class instance of such properties creates a new instance of that property.
The human visible text contents of an element for a property represents the value of that property, with a few exceptions:
If an <abbr> element is used for a property, then the 'title' attribute (if present) of the <abbr> element is the value of the property, instead of the contents of the element, which instead provide a more human presentable version of the value.
If an <a> element is used for one or more properties, it MUST be treated as follows:
If an <img> element is used for one or more properties, it MUST be treated as follows:
If an <object> element is used for one or more properties, it MUST be treated as follows:
Sometimes only part of an element which is the equivalent for a property is used for the value of the property. This typically occurs when a property has a subtype, like 'tel'. For this purpose, the special class name "value" is used to excerpt out the subset of the element that is the value of the property. E.g. here is an hCard fragment for marking up a home phone number:
This hCard fragment could be displayed as:
home: +1.415.555.1212
You may want to customize/localize the visible punctuation and not want to include it in what machines see. Use multiple class="value" elements which are then concatenated. E.g.
No change in display, but the parsed hCard property value then becomes in vCard:
vCard has several properties which either do not make sense on, or are already implied within the context of a web page. This section explains what to (not) do with them.
If the "FN" and "ORG" (organization) properties have the exact same value (typically because they are set on the same element, e.g. class="fn org"), then the hCard represents contact information for a company, organization or place and SHOULD be treated as such. In this case the author also MUST NOT set the "N" property, or set it (and any sub-properties) explicitly to the empty string "". Thus parsers SHOULD handle the missing "N" property, in this case by implying empty values for all the "N" sub-properties.
Although vCard requires that the "N" property be present, the authors of the vCard specification (RFC2426) themselves do not i
访问原文 返回搜索 http://microformats.org/wiki/hCard
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。