hCard Microformat

Roger Costello

Click arrow key () to navigate to next page

Purpose of the hCard Microformat

Additional Information

Person, Company, Organization, Place

Categories of Properties

Identification Properties

fn Property

  1. <html>
  2. <head>
  3. <title>Today's Speaker</title>
  4. </head>
  5. <body>
  6. <p>Today's speaker is <cite>John Smith</cite></p>
  7. </body>
  8. </html>

fn Property

  1. <html>
  2. <head>
  3. <title>Today's Speaker</title>
  4. </head>
  5. <body>
  6. <p>Today's speaker is
  7. <cite class="vcard">
  8. <span class="fn">John Smith</span>
  9. </cite>
  10. </p>
  11. </body>
  12. </html>

No Impact to Presentation

vCard Format

  1. BEGIN:VCARD
  2. PRODID:-//suda.co.uk//X2V 0.8.4.2 (BETA)//EN
  3. SOURCE:(Best Practices states this should be the URL the vcard was transformed from)
  4. NAME:Today's Speaker
  5. VERSION:3.0
  6. N;LANGUAGE=en;CHARSET=UTF-8:Smith;John;;;
  7. FN;LANGUAGE=en;CHARSET=UTF-8:John Smith
  8. END:VCARD

hCard to vCard Converter

Is your hCard Markup Correct?

Name is Scattered About the HTML

  1. John will be our speaker. Dr. Smith will talk about ...
  1. <span class="fn">John will be our speaker. Dr. Smith</span> will talk about ...

Value Property

  1. <span class="vcard">
  2. <span class="fn">
  3. <span class="value">John </span>
  4. will be our speaker. Dr.
  5. <span class="value">Smith</span>
  6. </span>
  7. </span>
  8. will talk about ...
  1. fn = concat('John ', 'Smith') = John Smith

Design #1

  1. <span class="fn">
  2. <span class="value">John </span>
  3. will be our speaker. Dr.
  4. <span class="value">Smith</span>
  5. </span>
  1. fn = concat('John ', 'Smith') = John Smith

Design #2

  1. <span class="fn">
  2. <span class="value">John</span>
  3. <span class="value"> </span>
  4. will be our speaker. Dr.
  5. <span class="value">Smith</span>
  6. </span>
  1. fn = concat('John', ' ', 'Smith') = John Smith

Design #3 (Best Practice)

  1. <abbr class="fn" title="John Smith">John</abbr>
  2. will be our speaker. Dr. Smith

abbr Design Pattern

  1. <abbr class="fn" title="John Smith">John</abbr>

n Property

n Property

  1. <html>
  2. <head>
  3. <title>Today's Speaker</title>
  4. </head>
  5. <body>
  6. <p>Today's speaker is <cite>Dr. John Q. Smith, M.D.</cite></p>
  7. </body>
  8. </html>

n Property

  1. <html>
  2. <head>
  3. <title>Today's Speaker</title>
  4. </head>
  5. <body>
  6. <p>Today's speaker is
  7. <span class="vcard">
  8. <cite class="fn n">
  9. <span class="honorific-prefix">Dr.</span>
  10. <span class="given-name">John</span>
  11. <abbr class="additional-name" title="Quinlin">Q.</abbr>
  12. <span class="family-name">Smith</span>,
  13. <span class="honorific-suffix">M.D.</span>
  14. </cite>
  15. </span>
  16. </p>
  17. </body>
  18. </html>

Optimization: Multiple Class Names

  1. <cite class="fn n">
  2. ...
  3. </cite>

Restrictions on Multiple Class Names

Continued ...