<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adam Trachtenberg &#187; Programming</title>
	<atom:link href="http://www.trachtenberg.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trachtenberg.com/blog</link>
	<description>Thoughts on PHP, eBay, and too many technical topics for my family's liking.</description>
	<lastBuildDate>Tue, 24 Aug 2010 21:39:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Trivia Contest: DOM + Default Namespaces</title>
		<link>http://www.trachtenberg.com/blog/2006/09/26/php-trivia-contest-dom-default-namespaces/</link>
		<comments>http://www.trachtenberg.com/blog/2006/09/26/php-trivia-contest-dom-default-namespaces/#comments</comments>
		<pubDate>Wed, 27 Sep 2006 00:03:24 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/09/26/php-trivia-contest-dom-default-namespaces/</guid>
		<description><![CDATA[Here&#8217;s a question based on a recent PHP bug report which shows why DOM is fun.
Given the following line of PHP:
$xml = DOMDocument::loadXML(
 '&#60;r xmlns=&#34;urn:a&#34;/&#62;');
The easy way to print the namespace URI of the root node, urn:a, is:
echo $xml->documentElement->namespaceURI;
But how do you retrieve it using DOMElement::GetAttributeNS()? What are the two magical input parameters to coax [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a question based on a recent PHP bug report which shows why DOM is fun.</p>
<p>Given the following line of PHP:</p>
<blockquote><p><code>$xml = DOMDocument::loadXML(<br />
 '&lt;r xmlns=&quot;urn:a&quot;/&gt;');</code></p></blockquote>
<p>The easy way to print the namespace URI of the root node, <code>urn:a</code>, is:</p>
<blockquote><p><code>echo $xml->documentElement->namespaceURI;</code></p></blockquote>
<p>But how do you retrieve it using <code>DOMElement::GetAttributeNS()</code>? What are the two magical input parameters to coax that value out?</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=644&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/09/26/php-trivia-contest-dom-default-namespaces/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP 5 + COM + Skype Help Wanted</title>
		<link>http://www.trachtenberg.com/blog/2006/09/12/php-5-com-skype-help-wanted/</link>
		<comments>http://www.trachtenberg.com/blog/2006/09/12/php-5-com-skype-help-wanted/#comments</comments>
		<pubDate>Tue, 12 Sep 2006 22:39:20 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ebay]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/09/12/php-5-com-skype-help-wanted/</guid>
		<description><![CDATA[This is a help wanted ad. Any assistance would be much appreciated.
I&#8217;m trying to use PHP 5.2 to talk to Skype via the COM extension and Skype4COM interface.
I&#8217;m using this example from the Skype Forum, but I get a COM exception of &#8220;Skype client is not installed.&#8221;
However, I do have Skype on my machine and [...]]]></description>
			<content:encoded><![CDATA[<p>This is a help wanted ad. Any assistance would be much appreciated.</p>
<p>I&#8217;m trying to use PHP 5.2 to talk to Skype via the <a href="http://www.php.net/com">COM extension</a> and <a href="https://developer.skype.com/Docs/Skype4COM">Skype4COM</a> interface.</p>
<p>I&#8217;m using <a href="http://forum.skype.com/index.php?s=&#038;showtopic=47585&#038;view=findpost&#038;p=226646">this example</a> from the Skype Forum, but I get a COM exception of &#8220;Skype client is not installed.&#8221;</p>
<p>However, I do have Skype on my machine and I&#8217;m <a href="http://forum.skype.com/index.php?s=&#038;showtopic=59155&#038;view=findpost&#038;p=276292">not the only one</a> with this problem, so I don&#8217;t think I&#8217;m completely crazy.</p>
<p>Unfortunately, I don&#8217;t normally develop on Windows or Skype, so it&#8217;s very hard for me to debug the COM extension. If anyone has some pointers on where I should start, it would be very useful. Thanks!</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=642&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/09/12/php-5-com-skype-help-wanted/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Stupid PHP one liners: Google calc</title>
		<link>http://www.trachtenberg.com/blog/2006/08/24/stupid-php-one-liners-google-calc/</link>
		<comments>http://www.trachtenberg.com/blog/2006/08/24/stupid-php-one-liners-google-calc/#comments</comments>
		<pubDate>Thu, 24 Aug 2006 07:03:05 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/08/24/stupid-php-one-liners-google-calc/</guid>
		<description><![CDATA[A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of Google Hacks.
I don&#8217;t know what caused by to look at that code again, but here&#8217;s the one line version:

print str_replace('&#60;font size=-2&#62; &#60;/font&#62;', ',' ,
 [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of <em>Google Hacks</em>.</p>
<p>I don&#8217;t know what caused by to look at that code again, but here&#8217;s the one line version:</p>
<pre>
print str_replace('&lt;font size=-2&gt; &lt;/font&gt;', ',' ,
  preg_replace('(.+&lt;b&gt;.+= (.+?)&lt;/b&gt;.+)s', '$1',
    file_get_contents('http://www.google.com/search?q=' .
      urlencode(join(' ', array_splice($argv, 1)))))) . &quot;\n&quot;;
</pre>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=635&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/08/24/stupid-php-one-liners-google-calc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View maps in Google search results</title>
		<link>http://www.trachtenberg.com/blog/2006/08/22/inline-maps-in-google-search-results/</link>
		<comments>http://www.trachtenberg.com/blog/2006/08/22/inline-maps-in-google-search-results/#comments</comments>
		<pubDate>Tue, 22 Aug 2006 23:50:16 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/08/22/inline-maps-in-google-search-results/</guid>
		<description><![CDATA[I came across a new (to me) feature of Google today: inline maps.

When a page has an address inside, Google offers to display a map:

Clicking on the [+] expands the image:

This is just a fixed image, not a AJAX scrolling panel. Clicking on the map sends you to the full AJAXy Google Maps site.
Interestingly enough, [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a new (to me) feature of Google today: inline maps.<br />
<span id="more-634"></span><br />
When a page has an address inside, Google offers to display a map:</p>
<p><a href="http://www.trachtenberg.com/images/KaiMapClosed.png"><img src="http://www.trachtenberg.com/images/KaiMapClosed.png" alt="Closed Google Map" /></a></p>
<p>Clicking on the <tt>[+]</tt> expands the image:</p>
<p><a href="http://www.trachtenberg.com/images/KaiMapOpen.png"><img src="http://www.trachtenberg.com/images/KaiMapOpen.png" alt="Open Google Map"  /></a></p>
<p>This is just a fixed image, not a AJAX scrolling panel. Clicking on the map sends you to the full AJAXy Google Maps site.</p>
<p>Interestingly enough, this feature went away when I logged out, so it may or may not work for you.</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=634&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/08/22/inline-maps-in-google-search-results/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>eBay Developer Program: Needs Biz Dev Techie</title>
		<link>http://www.trachtenberg.com/blog/2006/08/22/ebay-developer-program-needs-biz-dev-techie/</link>
		<comments>http://www.trachtenberg.com/blog/2006/08/22/ebay-developer-program-needs-biz-dev-techie/#comments</comments>
		<pubDate>Tue, 22 Aug 2006 18:01:50 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ebay]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/08/22/ebay-developer-program-needs-biz-dev-techie/</guid>
		<description><![CDATA[The group at eBay where I work, the Developers Program, is looking to hire a biz dev person that&#8217;s also at least a little techie.
Here&#8217;s the key requirements:

Work with eBayâ€™s Internet Marketing and Product Management teams to define and enable third-party development of applications to drive activity to eBay.com.
Evangelize and communicate the benefits of developing [...]]]></description>
			<content:encoded><![CDATA[<p>The group at eBay where I work, the <a href="http://developer.ebay.com">Developers Program</a>, is looking to hire a biz dev person that&#8217;s also at least a little techie.</p>
<p>Here&#8217;s the key requirements:</p>
<ul>
<li>Work with eBayâ€™s Internet Marketing and Product Management teams to define and enable third-party development of applications to drive activity to eBay.com.</li>
<li>Evangelize and communicate the benefits of developing on the eBay Platform using our Application Programming Interface (API) and other web services to third parties (primarily affiliates) through conference appearances, one-on-one interaction and personal innovation.</li>
<li>Maintain and continue to develop/streamline the platform access infrastructure for third parties.</li>
</ul>
<p>And here&#8217;s <a href="https://sjobs.brassring.com/EN/ASP/TG/cim_jobdetail.asp?jobId=426171&#038;type=search&#038;JobReqLang=1&#038;recordstart=1&#038;JobSiteId=195&#038;JobSiteInfo=426171_195&#038;GQId=0">the full description</a>. (If that link doesn&#8217;t work, go to <a href="http://www.ebaycareers.com/">ebaycareers.com</a> and search for job &#8220;12439BR&#8221;.)</p>
<p>If you&#8217;re interested, please e-mail me. The domain is &#8220;ebay.com&#8221; and my username is &#8220;atrachtenberg&#8221;.</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=633&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/08/22/ebay-developer-program-needs-biz-dev-techie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My favorite new style of printf</title>
		<link>http://www.trachtenberg.com/blog/2006/05/20/my-favorite-new-style-of-printf/</link>
		<comments>http://www.trachtenberg.com/blog/2006/05/20/my-favorite-new-style-of-printf/#comments</comments>
		<pubDate>Sun, 21 May 2006 01:44:07 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/05/20/my-favorite-new-style-of-printf/</guid>
		<description><![CDATA[I just discovered vsprintf(), which accepts a formatting string and an array of arguments:

// logging function that accepts printf-style formatting
// it prints a time stamp, the string, and a new line
function logf() {
	$date = date(DATE_RSS);
	$args = func_get_args();
	$format = array_shift($args);

	return print &#34;$date: &#34; . vsprintf($format, $args) . &#34;\n&#34;;
}

Just sharing.
]]></description>
			<content:encoded><![CDATA[<p>I just discovered <code>vsprintf()</code>, which accepts a formatting string and an array of arguments:</p>
<pre><code>
// logging function that accepts printf-style formatting
// it prints a time stamp, the string, and a new line
function logf() {
	$date = date(DATE_RSS);
	$args = func_get_args();
	$format = array_shift($args);

	return print &quot;$date: &quot; . vsprintf($format, $args) . &quot;\n&quot;;
}
</code></pre>
<p>Just sharing.</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=564&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/05/20/my-favorite-new-style-of-printf/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Did you know about PHP&#8217;s old_function?</title>
		<link>http://www.trachtenberg.com/blog/2006/04/05/did-you-know-about-phps-old_function/</link>
		<comments>http://www.trachtenberg.com/blog/2006/04/05/did-you-know-about-phps-old_function/#comments</comments>
		<pubDate>Wed, 05 Apr 2006 23:52:04 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upgrading to php 5]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/04/05/did-you-know-about-phps-old_function/</guid>
		<description><![CDATA[I was reviewing Upgrading to PHP 5 today and I came across this lovely section in Appendix B, which I had completely forgotten about:
PHP/FI had a quirky function declaration syntax:
function sum $a, $b (
    return($a + $b);
);

This was changed in PHP 3, but you could continue to use the old form in [...]]]></description>
			<content:encoded><![CDATA[<p>I was reviewing <em><a href="http://www.trachtenberg.com/blog/2004/05/15/upgrading-to-php-5/">Upgrading to PHP 5</a></em> today and I came across this lovely section in Appendix B, which I had completely forgotten about:</p>
<blockquote><p>PHP/FI had a quirky function declaration syntax:</p>
<pre><code>function sum $a, $b (
    return($a + $b);
);
</code></pre>
<p>This was changed in PHP 3, but you could continue to use the old form in PHP 3 and PHP 4 if you declared your function as an old_function:</p>
<pre><code>old_function sum $a, $b (
    return($a + $b);
);
</code></pre>
<p>Alas, after six years, this backward compatibility feature is now gone. Another nostalgic remnant of PHP/FI has passed away.</p></blockquote>
<p>I must say, I used PHP/FI, but I never resorted to the <code>old_function</code> hack to ease my PHP 3 migration issues.</p>
<p>Did anybody ever use this?</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=502&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/04/05/did-you-know-about-phps-old_function/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Auctioning Autographed &#8220;Upgrading to PHP 5&#8243; for the EFF</title>
		<link>http://www.trachtenberg.com/blog/2006/02/11/auctioning-autographed-upgrading-to-php-5-for-the-eff/</link>
		<comments>http://www.trachtenberg.com/blog/2006/02/11/auctioning-autographed-upgrading-to-php-5-for-the-eff/#comments</comments>
		<pubDate>Sun, 12 Feb 2006 02:18:10 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[charity]]></category>
		<category><![CDATA[ebay]]></category>
		<category><![CDATA[eff]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upgrading to php 5]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2006/02/11/auctioning-autographed-upgrading-to-php-5-for-the-eff/</guid>
		<description><![CDATA[Every since I started at eBay, I&#8217;ve been looking to sell more on the site. I&#8217;ve also been looking to donate more money to charity. So I decided to combine the two: I&#8217;m selling a copy of Upgrading to PHP 5  on eBay and donating everything to the EFF.
The EFF, short for Electronic Frontier [...]]]></description>
			<content:encoded><![CDATA[<p>Every since I started at eBay, I&#8217;ve been looking to sell more on the site. I&#8217;ve also been looking to donate more money to charity. So I decided to combine the two: I&#8217;m selling a copy of <em><a href="http://www.oreilly.com/catalog/upgradephp5/">Upgrading to PHP 5 </a></em> on eBay and donating everything to the <a href="http://www.eff.org/">EFF</a>.</p>
<p>The EFF, short for Electronic Frontier Foundation, describes themselves as:</p>
<blockquote><p>[A] group of passionate people â€” lawyers, technologists, volunteers, and visionaries â€” working in the trenches, battling to protect your rights and the rights of web surfers everywhere. The dedicated people of EFF challenge legislation that threatens to put a price on what is invaluable; to control what must remain boundless.</p></blockquote>
<p>List priced at $29.99, the auction starts at $0.01, so you&#8217;re guaranteed to get a good value. As an extra special bonus, I will custom autograph the book to the winning bidder or a friend. Or, for an additional $5, I will not sully up your clean new book with my autograph. Your choice. Okay, just kidding about the $5.</p>
<p>If you&#8217;ve been looking to get up to speed on PHP 5, now&#8217;s the perfect chance to buy a book and give money to a great cause. Check out my listing and <a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&#038;item=4612780421&#038;rd=1&#038;sspagename=STRK%3AMESE%3AIT&#038;rd=1">bid today</a>.</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=452&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2006/02/11/auctioning-autographed-upgrading-to-php-5-for-the-eff/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>My eBay Motors Maps Mashup</title>
		<link>http://www.trachtenberg.com/blog/2005/12/19/my-ebay-motors-maps-mashup/</link>
		<comments>http://www.trachtenberg.com/blog/2005/12/19/my-ebay-motors-maps-mashup/#comments</comments>
		<pubDate>Mon, 19 Dec 2005 22:34:12 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ebay]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2005/12/19/my-ebay-motors-maps-mashup/</guid>
		<description><![CDATA[In my copious free time, I have been writing a little mashup using eBay Motors and Google Maps. This is equal parts eBay Web services marking, a learning exercize, and an excuse to code.
Like all Web 2.0 concepts, it&#8217;s in perpetual beta. (Why does &#8220;perpetual beta&#8221; seem like the Web 2.0 phrase for Web 1.0&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>In my copious free time, I have been writing a little mashup using <a href="http://www.trachtenberg.com/emgm/">eBay Motors and Google Maps</a>. This is equal parts <a href="http://developer.ebay.com">eBay Web services</a> marking, a learning exercize, and an excuse to code.</p>
<p>Like all Web 2.0 concepts, it&#8217;s in perpetual beta. (Why does &#8220;perpetual beta&#8221; seem like the Web 2.0 phrase for Web 1.0&#8217;s &#8220;<a href="http://images.google.com/images?q=this+page+is+under+construction&#038;imgsz=icon">Under Construction</a>&#8221; image?) Thanks to a helpful prod, I sat down this morning and fixed the outstanding IE bugs, so now it works in IE, Firefox, and Safari. That means I can officially blog about it.</p>
<p>For those of you interested in the technical details, the backend code is written in PHP 5. I&#8217;m using the ext/soap extension to talk with eBay Web services and PEAR&#8217;s HTML_QuickForm, HTML_Javascript, and Date packages. I tried to use HTML_AJAX, but it was buggy when I first tried it; I see there have been many recent updates, so I should look again.</p>
<p>Not surprisingly, writing the PHP part was pretty easy. It was the JavaScript code that took forever and a day to write and debug. Many thanks to the <a href="http://www.quirksmode.org/">QuirksMode</a> Web site for documenting cross-browser woes.</p>
<p>Please <a href="http://www.trachtenberg.com/emgm/">check out the site</a> and let me know what you think.</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=418&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2005/12/19/my-ebay-motors-maps-mashup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Tip: Assigning Multiple Classes to a Single Element</title>
		<link>http://www.trachtenberg.com/blog/2005/11/22/css-tip-assigning-multiple-classes-to-a-single-element/</link>
		<comments>http://www.trachtenberg.com/blog/2005/11/22/css-tip-assigning-multiple-classes-to-a-single-element/#comments</comments>
		<pubDate>Tue, 22 Nov 2005 17:42:31 +0000</pubDate>
		<dc:creator>Adam Trachtenberg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.trachtenberg.com/blog/2005/11/22/css-tips-assigning-multiple-classes-to-a-single-element/</guid>
		<description><![CDATA[The 37signals team wrote up a nice trick on creating a default styling for an element using an element id and then customizing it using an element class.
Here&#8217;s one of their examples:

#Flash {
  text-align: left;
  border: 1px solid #ccc;
  font-size: 14px;
  margin: 0 7px 12px 0;
  padding: 5px 5px 5px [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://37signals.com">37signals</a> team wrote up <a href="http://37signals.com/svn/archives2/css_tip_create_a_default_with_special_cases.php">a nice trick</a> on creating a default styling for an element using an element id and then customizing it using an element class.</p>
<p>Here&#8217;s one of their examples:</p>
<pre>
#Flash {
  text-align: left;
  border: 1px solid #ccc;
  font-size: 14px;
  margin: 0 7px 12px 0;
  padding: 5px 5px 5px 30px;
}

div#Flash.good {
  border-color: #9c9;
  color: #060;
  background: url(/images/alertgood_icon.gif) #E2F9E3 left no-repeat;
}

&lt;div id=&quot;Flash&quot; class=&quot;good&quot;&gt;Oh yes, that's nice!&lt;/div&gt;
</pre>
<p>This technique is nice when you have one specific element that needs decorating. Since element ids are unique within a document, you can apply the exact formatting you need to that one section. However, you need to define an explicit CSS block &#8212; <tt>div#Flash.good</tt> in this case &#8212; each time you wish to combine styles.</p>
<p>A similar approach is assigning multiple classes to the same element:</p>
<pre>
.Flash {
  text-align: left;
  border: 1px solid #ccc;
  font-size: 14px;
  margin: 0 7px 12px 0;
  padding: 5px 5px 5px 30px;
}

.good {
  border-color: #9c9;
  color: #060;
  background: url(/images/alertgood_icon.gif) #E2F9E3 left no-repeat;
}

&lt;div class=&quot;Flash good&quot;&gt;Oh yes, that's nice!&lt;/div&gt;
</pre>
<p>Use this to compose more general styles. For example, if you want all error text to be red and bold, you could define a general error class. You can then use that style anywhere in the document with any other style without needing to update your CSS.</p>
<p>Nothing too earth shattering, but two good tools to have in your bag.</p>
<img src="http://www.trachtenberg.com/blog/?ak_action=api_record_view&id=378&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.trachtenberg.com/blog/2005/11/22/css-tip-assigning-multiple-classes-to-a-single-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
