views:

57

answers:

2

Is the "id" attribute allowed in microformats? Example (hCard microformat):

<div class="tel" id="voice">
  <span class="type">Voice</span>
  <span class="value">(206) 555-1234</span>
</div>
<div class="tel" id="fax">
  <span class="type">Fax</span>
  <span class="value">(206) 555-5678</span>
</div>
+2  A: 

It is allowed but ignored by the standard. All properties have to be declared by classes:

Elements with class names of the listed properties represent the values of those properties.

Gumbo
But it's ok to use the id attribute for purposes of CSS styling?
phenry
Yes, of course. They don’t conflict with your hcard declarations.
Gumbo
Just wanted to confirm Gumbo's answer. The id attribute won't affect microformat parsing. It's perfectly acceptable for formatting use, anchoring, etc.
Gabriel Hurley
A: 

Don't also hesitate to validate your markup: http://hcard.geekhood.net/

abernier