<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MatthiasLuedtke</id>
	<title>Microformats Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MatthiasLuedtke"/>
	<link rel="alternate" type="text/html" href="https://microformats.org/wiki/Special:Contributions/MatthiasLuedtke"/>
	<updated>2026-05-14T07:23:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://microformats.org/wiki/index.php?title=class-design-pattern&amp;diff=6137</id>
		<title>class-design-pattern</title>
		<link rel="alternate" type="text/html" href="https://microformats.org/wiki/index.php?title=class-design-pattern&amp;diff=6137"/>
		<updated>2006-04-02T12:42:35Z</updated>

		<summary type="html">&lt;p&gt;MatthiasLuedtke: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Class design pattern =&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Use the [[class-design-pattern]] to indicate semantic meaning about XHTML elements&lt;br /&gt;
&lt;br /&gt;
== How to use it ==&lt;br /&gt;
* add semantics to (X)HTML by using [http://www.w3.org/TR/REC-html40/struct/global.html#adef-class class names].  The &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; attribute is a space sepearted list of class names.&lt;br /&gt;
* if an appropriate semantic element is not available, use &amp;lt;code&amp;gt;span&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;div&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
This is one of the most frequently occurring design patterns in microformats. Semantic meaning can be indicated on XHTML content by using the &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;vcard&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;a class=&amp;quot;url fn&amp;quot; href=&amp;quot;http://tantek.com/&amp;quot;&amp;gt;Tantek Çelik&amp;lt;/a&amp;gt;,&lt;br /&gt;
 &amp;lt;span class=&amp;quot;org&amp;quot;&amp;gt;Technorati&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note especially the preceding example:&lt;br /&gt;
&lt;br /&gt;
* the section of the XHTML document that the microformat is being applied to is defined by &amp;lt;code&amp;gt;class=&amp;quot;vcard&amp;quot;&amp;lt;/code&amp;gt;. This is very common among non-trivial microformats.&lt;br /&gt;
* the use of both inline (&amp;amp;lt;a&amp;gt; and &amp;amp;lt;span&amp;gt;) and block (&amp;amp;lt;div&amp;gt;) level elements. This provides the microformat designer with a range of options for inserting semantic information without interfering with existing presentation&lt;br /&gt;
* the use of multiple class names on a single element (such as &amp;lt;code&amp;gt;&amp;quot;url fn&amp;quot;&amp;lt;/code&amp;gt;). This allows:&lt;br /&gt;
** single elements to have multiple meanings&lt;br /&gt;
** allows adding semantics to existing presentation&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Main_Page#Design_Patterns|All microformat design patterns]]&lt;br /&gt;
* John Udell [http://weblog.infoworld.com/udell/2004/02/09.html writes] about multiple class names&lt;br /&gt;
* [http://www.w3.org/TR/REC-html40/struct/global.html#adef-class HTML 4.0 defintion of 'class'], including notes about multiple class names&lt;/div&gt;</summary>
		<author><name>MatthiasLuedtke</name></author>
	</entry>
</feed>