CSS Lint
The About[1] page, which explains the linter's rules, should be more prominently linked I think.<p>I am very much an amateur at CSS. I know the basic rules (I hope), but I'm definitely not a designer or an expert. After running some CSS through the linter, though, and reading the About page, I have a few questions.<p>First: Why are IDs bad? The About page says:<p>>> <i>Don't use IDs in selectors<p>IDs shouldn't be used in selectors because these rules are too tightly coupled with the HTML and have no possibility of reuse. It's much preferred to use classes in selectors and then apply a class to an element in the page.</i><p>I don't quite follow. Isn't the whole point of an ID that it is like a class, but unique? Why exactly would it be better to change all ids to classes with only one member? (I don't even see how that would be different, except for making it less obvious to me that they're unique.) <i>Edit</i>: the context about OOCSS which Jacobr mentions below helps explain this.<p>Second: Why is it so important that heading styles be declared in exactly one spot. Again, the About page:<p>>> <i>Heading styles should only be defined once<p>Heading elements (h1-h6) should have exactly one rule on a site. CSS Lint warns if it finds more than one.</i><p>I ran into this because I had one ruleset for h1, h2, h3, etc. to make <i>all</i> the headings use the same font and color, but then I had distinct blocks for settings that I wanted to be different. (Example, I wanted the h1 to be larger and have a different bottom margin from h2 or h3. And so on.) I could easily duplicate things so that each set of rules was in exactly one block, but that would make the stylesheet less DRY.<p>(Edit - putting my cards on the table, here's the CSS I checked: <a href="http://ithaca.arpinum.org/css/screen.css" rel="nofollow">http://ithaca.arpinum.org/css/screen.css</a>. I definitely don't doubt it could be improved.)<p>[1] <a href="http://csslint.net/about.html" rel="nofollow">http://csslint.net/about.html</a>