Wolf’s Little Store

November 27, 2007

Semantic class names - get real

This kind of blog post pisses me off. This is written by the kind of people that just read Trancending CSS and feel enlightened now.

You’re throwing around the wrong examples. Class names on micro level mean nothing. If a table cell has a class="marked", I’ll inspect it with Firebug to see what this class does. I don’t care if the class is called left, or green. At least these classes gives me a decent hint what the class does.

Semantic class and id naming only makes sense in the bigger picture. If your containing div is called container, or page, if your content div is called content, your sidebar blocks called sidebar, I immediately know what’s going on. I get what you’re trying to say with those class names - and when I need to know the details, I’ll investigate. No matter how semantic your class name is, the only person that’s going to immediately get what it means is you.

Each minute you spend making up semantic class names is a minute less you can spend on doing something meaningful to improve the website you’re working on. Like labelling your forms, or optimizing file sizes.

14 responses

Leave a Reply

Write in English, stay on-topic and polite.