Lach and James had some good comments regarding my classing of <em> post from the other day. Lach pointed out
As for <em class=”strong”>, that’s a bad use of a class there. That’s implying presentation in your class. Let’s say at some point in the future, you change your site design, and your strongly emphasized elements need changing. In your stylistics you’d then have the weird situation of setting em.bold to have a normal font-weight.
James helped clarify this for me with his simple “basing class and id on structure, not style.”
I think I still have a valid idea, I just presented it sloppily — I used class="strong" and class="italic" for convenience. What I should have written was something along the lines of class="e1" and class="e2". This would eliminate the odd confusion that Lach pointed out, and sort of covers James point. These classes simply point out that there are two different types of emphasis.
But I’m not really convinced by my own argument. That still seems to be using a class for style, it’s just hidden behind some semi-meaningless syntax.
So, let’s look at the elements again — <em> and <strong>. They both are used to add some sort of emphasis to text. Style them how you will, browsers will by default typically style them with italics and bold respectively.
But again, the elements do the same thing: add emphasis. So, what if there was simply an <emphasis> element that had different allowable states? Something like:
<emphasis type="important"> = this is important
<emphasis type="strong"> = speak loudly now
<emphasis type="lang"> = je ne sais pas
where type=”…” could be treated like a pseudo element. The corresponding style sheet would then define the types:
emphasis:lang {font-style: italic;}
Perhaps foreign language don’t belong as a type. Perhaps book titles do. Perhaps there should be some defined allowable list of types. Or not. I’ll leave those picky details for another time (and more qualified people). The heart of the matter is, do we need two elements that provide emphasis or is there a better way?
In the meantime, I will go about using <em> and <strong> for italic and bold, and I will deal with book titles, foreign language, etc. as best I can when I come across them.