<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: CSS Naming Convention for Classes and IDs?</title>
	<atom:link href="http://justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/feed/" rel="self" type="application/rss+xml" />
	<link>http://justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/</link>
	<description>Refreshed and starting clean, but lots to organize and streamline.</description>
	<lastBuildDate>Thu, 25 Feb 2010 19:07:15 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sherwin</title>
		<link>http://justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/comment-page-1/#comment-941</link>
		<dc:creator>sherwin</dc:creator>
		<pubDate>Thu, 05 Feb 2009 23:24:48 +0000</pubDate>
		<guid isPermaLink="false">http://beta.thinkpile.com/justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/#comment-941</guid>
		<description>&quot;underscore_Separated_Camel_Case&quot; haha--scary.

Yah, I agree with you with regards to the use of camelCasing in development (backend). Meanwhile, interesting insight which makes sense with regards to the use of hyphens being tied to style rules. In regards to text editors, thank God for TextMate and Notepad++ =)</description>
		<content:encoded><![CDATA[<p>&#8220;underscore_Separated_Camel_Case&#8221; haha&#8211;scary.</p>
<p>Yah, I agree with you with regards to the use of camelCasing in development (backend). Meanwhile, interesting insight which makes sense with regards to the use of hyphens being tied to style rules. In regards to text editors, thank God for TextMate and Notepad++ =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anselm Bradford</title>
		<link>http://justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/comment-page-1/#comment-940</link>
		<dc:creator>Anselm Bradford</dc:creator>
		<pubDate>Thu, 05 Feb 2009 23:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://beta.thinkpile.com/justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/#comment-940</guid>
		<description>It&#039;s an interesting legacy behavior though, and could explain where the hyphenated CSS selectors convention came from (&lt;a href=&quot;http://marxsoftware.blogspot.com/2008/11/cascading-style-sheets-flex-3-style.html&quot; rel=&quot;nofollow&quot;&gt;I might note that Adobe Flex still does this with CSS&lt;/a&gt;). I was doing some searching on a solid reason for using hyphens, but was not able to find anything conclusive, which surprised me since it really does seem like the predominant format.

The only vague reason (aside from the past behavior of being stripped out by the DOM) I could find for hyphenation over other formats is that hyphenation follows the format of CSS attributes (font-size, text-decoration, etc.).

Others have said they use a underscore instead because &quot;-&quot; has another meaning in the scripting world, that of the subtraction operator. 

In a certain respect camelCase would actually make the most sense, because it would make it consistent with other programming paradigms. The classes and ID&#039;s on an HTML page could be thought of as object instances, which by convention are written in camelCase in other languages. But this is stretching CSS beyond what it actually is. 

The underscore and hyphen are more readable, which is important, but an annoyance I find with them is that many text editors see each part of a hyphenated word as a separate part, so when you double-click on the name (say to copy and paste it elsewhere) the whole name does not get selected. This happens more so with hyphens than with underscores from my experience.

And then I&#039;ve also seen underscore_Separated_Camel_Case, yikes!</description>
		<content:encoded><![CDATA[<p>It&#8217;s an interesting legacy behavior though, and could explain where the hyphenated CSS selectors convention came from (<a href="http://marxsoftware.blogspot.com/2008/11/cascading-style-sheets-flex-3-style.html" rel="nofollow">I might note that Adobe Flex still does this with CSS</a>). I was doing some searching on a solid reason for using hyphens, but was not able to find anything conclusive, which surprised me since it really does seem like the predominant format.</p>
<p>The only vague reason (aside from the past behavior of being stripped out by the DOM) I could find for hyphenation over other formats is that hyphenation follows the format of CSS attributes (font-size, text-decoration, etc.).</p>
<p>Others have said they use a underscore instead because &#8220;-&#8221; has another meaning in the scripting world, that of the subtraction operator. </p>
<p>In a certain respect camelCase would actually make the most sense, because it would make it consistent with other programming paradigms. The classes and ID&#8217;s on an HTML page could be thought of as object instances, which by convention are written in camelCase in other languages. But this is stretching CSS beyond what it actually is. </p>
<p>The underscore and hyphen are more readable, which is important, but an annoyance I find with them is that many text editors see each part of a hyphenated word as a separate part, so when you double-click on the name (say to copy and paste it elsewhere) the whole name does not get selected. This happens more so with hyphens than with underscores from my experience.</p>
<p>And then I&#8217;ve also seen underscore_Separated_Camel_Case, yikes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sherwin</title>
		<link>http://justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/comment-page-1/#comment-939</link>
		<dc:creator>sherwin</dc:creator>
		<pubDate>Thu, 05 Feb 2009 22:14:22 +0000</pubDate>
		<guid isPermaLink="false">http://beta.thinkpile.com/justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/#comment-939</guid>
		<description>Thanks for the input Anselm. Like you said, time and tech have changed. Currently, I use hyphens but I use this convention when naming IDs for my forms:

#formName

I recall running into a problem with DOM and forms ID-names specifically a while back. I HTH. Have a good one.</description>
		<content:encoded><![CDATA[<p>Thanks for the input Anselm. Like you said, time and tech have changed. Currently, I use hyphens but I use this convention when naming IDs for my forms:</p>
<p>#formName</p>
<p>I recall running into a problem with DOM and forms ID-names specifically a while back. I HTH. Have a good one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anselm Bradford</title>
		<link>http://justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/comment-page-1/#comment-937</link>
		<dc:creator>Anselm Bradford</dc:creator>
		<pubDate>Thu, 05 Feb 2009 21:54:33 +0000</pubDate>
		<guid isPermaLink="false">http://beta.thinkpile.com/justamemo.com/2006/08/18/css-naming-convention-for-classes-and-ids/#comment-937</guid>
		<description>The O&#039;Reilly book &lt;a href=&quot;http://books.google.com/books?id=sYoAt65E1VoC&amp;pg=PA340&amp;lpg=PA340&amp;dq=strips+hyphen+css&amp;source=web&amp;ots=aQ7mJQQYit&amp;sig=nuYyqjvrpCQIxAWhZOc9gD3cZas&amp;hl=en&amp;ei=wF2LSYP0JISENYHIwdMH&amp;sa=X&amp;oi=book_result&amp;resnum=5&amp;ct=result&quot; rel=&quot;nofollow&quot;&gt;JavaScript &amp; DHTML Cookbook&lt;/a&gt; indicates that the DOM strips out hyphens in CSS ID&#039;s and replaces them with camelCase, but this no longer appears to be the case. I am not able to reproduce that effect anyway, but that book is from 2003 and this post is from 2006, so my guess is times (and technology) have changed.</description>
		<content:encoded><![CDATA[<p>The O&#8217;Reilly book <a href="http://books.google.com/books?id=sYoAt65E1VoC&amp;pg=PA340&amp;lpg=PA340&amp;dq=strips+hyphen+css&amp;source=web&amp;ots=aQ7mJQQYit&amp;sig=nuYyqjvrpCQIxAWhZOc9gD3cZas&amp;hl=en&amp;ei=wF2LSYP0JISENYHIwdMH&amp;sa=X&amp;oi=book_result&amp;resnum=5&amp;ct=result" rel="nofollow">JavaScript &amp; DHTML Cookbook</a> indicates that the DOM strips out hyphens in CSS ID&#8217;s and replaces them with camelCase, but this no longer appears to be the case. I am not able to reproduce that effect anyway, but that book is from 2003 and this post is from 2006, so my guess is times (and technology) have changed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
