class-design-pattern: Difference between revisions
Jump to navigation
Jump to search
DavidJanes (talk | contribs) No edit summary |
DavidJanes (talk | contribs) mNo edit summary |
||
Line 15: | Line 15: | ||
* the use of both inline (<a> and <span>) and block (<div>) level elements. This provides the microformat designer with a range of options for inserting semantic information without interfering with existing presentation | * the use of both inline (<a> and <span>) and block (<div>) level elements. This provides the microformat designer with a range of options for inserting semantic information without interfering with existing presentation | ||
* the use of multivalued CSS class elements (such as <code>"url fn"</code>). This | * the use of multivalued CSS class elements (such as <code>"url fn"</code>). This allows: | ||
** single elements to have multiple meanings | ** single elements to have multiple meanings | ||
** allows semantic meaning to be added to existing presentation | ** allows semantic meaning to be added to existing presentation |
Revision as of 14:32, 9 October 2005
Class design pattern
This is one of the most frequently occurring design patterns in microformats. Semantic meaning can be indicated on XHTML content by using the 'class' attribute of an enclosing element.
For example, hcard adds information indicating that certain elements are a vCard URL, a Full Name and Organization by the class design pattern:
<div class="vcard"> <a class="url fn" href="http://tantek.com/">Tantek Çelik</a>, <span class="org">Technorati</span> </div>
Note especially the preceding example:
- the use of both inline (<a> and <span>) and block (<div>) level elements. This provides the microformat designer with a range of options for inserting semantic information without interfering with existing presentation
- the use of multivalued CSS class elements (such as
"url fn"
). This allows:- single elements to have multiple meanings
- allows semantic meaning to be added to existing presentation
See Also
- John Udel writes about multi-valued CSS elements