- Starting Basic
- Sensible Semantics
- But How Far is Too Far?
- And Even Farther...
- The Edges of Meaning
And Even Farther...
As far as this argument for descriptive ID and class names already goes, it can go at least one step further. While on a plane returning from SXSW with Dave Shea, cultivator of the CSS Zen Garden and the co-author of our book The Zen of CSS Design from New Riders, I was taken to task about this issue. We'd presented on a panel together with other CSS experts including Dan Cederholm (author of Web Standard Solutions), Douglas Bowman (Stopdesign.com), and Christopher Schmitt (author of Designing CSS Web Pages), and I had made this very point. Dave's take was that function changes, too, which is an important point. As long as the navigation remains navigation, it's well and good to name it in accordance to its function.
So what happens when the design team determines that the area being used for navigation would be better used for news items? Suddenly we have something named #nav whose function has changed completely. So a very similar problem arises.
How do we get around this concern? Well, at this time the best advice is to really study your situation carefully before creating class and ID names. Naturally, not everyone is in this position. We're often retrofitting sites or redesigning them in some way rather than having the luxury of planning. Maybe it's a copout to say "do the best you can," but that's really where we are today. We do know that naming something for its function rather than presentation is a step in the right direction and certainly a better practice than naming for presentational purposes. But how to manage issues of function is something we're going to be discussing more in months and years to come.