HCard

From WikiMD's Wellness Encyclopedia

hCard[edit | edit source]

hCard is a microformat used to represent people, companies, organizations, and places in (X)HTML, Atom, RSS, or arbitrary XML. It is a simple, open format that allows for the embedding of vCard data in web pages, making it easier to share contact information across the web.

Overview[edit | edit source]

hCard is a microformat that uses a 1:1 representation of the vCard standard, which is a widely used format for electronic business cards. The hCard format allows for the embedding of vCard data within HTML and other XML-based languages, enabling web pages to contain rich, semantic contact information that can be easily extracted and used by other applications.

Structure[edit | edit source]

An hCard is typically embedded in a web page using a combination of HTML elements and specific class names. The basic structure of an hCard includes the following elements:

  • fn (formatted name): The full name of the person or organization.
  • n (name): A structured representation of the name, including components such as given-name, family-name, etc.
  • org (organization): The name of the organization.
  • adr (address): The physical address, which can include components like street-address, locality, region, postal-code, and country-name.
  • tel (telephone): A telephone number.
  • email: An email address.
  • url: A URL associated with the person or organization.

Example[edit | edit source]

Here is a simple example of an hCard embedded in HTML:

<div class="vcard">
  <a class="url fn" href="http://www.example.com">John Doe</a>
  <div class="org">Example Company</div>
  <div class="adr">
    <span class="street-address">123 Example Street</span>, 
    <span class="locality">Example City</span>, 
    <span class="region">EX</span>, 
    <span class="postal-code">12345</span>
  </div>
  <div class="tel">+1-555-555-5555</div>
  <a class="email" href="mailto:john.doe@example.com">john.doe@example.com</a>
</div>

Applications[edit | edit source]

hCard data can be used by various applications to extract and utilize contact information. For example, web browsers and other tools can parse hCard data to allow users to easily add contacts to their address books. Search engines can also use hCard data to enhance search results with rich snippets.

See Also[edit | edit source]

External Links[edit | edit source]

WikiMD
Navigation: Wellness - Encyclopedia - Health topics - Disease Index‏‎ - Drugs - World Directory - Gray's Anatomy - Keto diet - Recipes

Search WikiMD

Ad.Tired of being Overweight? Try W8MD's physician weight loss program.
Semaglutide (Ozempic / Wegovy and Tirzepatide (Mounjaro / Zepbound) available.
Advertise on WikiMD

WikiMD's Wellness Encyclopedia

Let Food Be Thy Medicine
Medicine Thy Food - Hippocrates

WikiMD is not a substitute for professional medical advice. See full disclaimer.
Credits:Most images are courtesy of Wikimedia commons, and templates Wikipedia, licensed under CC BY SA or similar.

Contributors: Prab R. Tumpati, MD