|
Posted by Joel Shepherd on 01/26/06 17:51
John Salerno <johnjsal@NOSPAMgmail.com> wrote:
> Also, as an example, what if I had a sentence like this:
>
> "The word void in a function indicates that there is no return type."
>
> If I'd like 'void' to stand out from the rest of the sentence (and
> ideally have it italicized), should I use <em>?
Probably not: there's more going on there than simple emphasis. It's not
equivalent to, say, "Your <em>what</em> hurts?!"
> I know I should have italics as a consideration when I choose <em>
Actually, you shouldn't. You should think of <em> as saying "the content
should be presented with emphasis". Italics don't enter the picture.
It's true that many browsers use italics to denote emphasis but there's
no requirement that they or you do so.
> The only other option I can think of would be:
>
> <span class="keyword">void</span>
>
> but is that a better way to do it?
I think so. The fact that in some contexts "void" is a keyword is
semantically important. HTML has no way to represent that bit of
semantics (though maybe <code> comes close: I forget if it's deprecated
or not). Emphasis is far enough removed from status as a programming
language keyword that it's probably not a good idea to, uh, overload it
with that meaning.
--
Joel.
Navigation:
[Reply to this message]
|