PDA

View Full Version : Italics, <em>, and accessibility


Erica C.
08-03-2006, 02:13 PM
I have a question about using italics appropriately and accessibility.

Sometimes it seems wrong to use <em> when what I want to do is to make a visual distinction in the text that's not about emphasis. Under those circumstances I think I should be using a span with font-style set to italic rather than <em>. It seems like using <em> instead of span is just using <em> as an <i> tag.

So, am I abusing <em> if I use it as if it were <i>?

Thanks.

Erica (wow, I hope that made sense)

Wassercrats
08-03-2006, 02:27 PM
Yes. <em> might appear bold instead of italic in some browsers. If you want italics for a title or something else that writers are taught to italicize, and not for emphasis, then use <i>. If you want italics for some stylistic reason that's not in the writer's manuals, use CSS. If you want to emphasize something by italicizing it, use <em> with CSS (font-style: italic).

Erica C.
08-03-2006, 03:25 PM
Thanks. I hadn't known that <em> can appear bold in some browsers. If <em> appears as bold, what does <strong> appear as?

Erica

johnfl68
08-03-2006, 04:16 PM
From World Wide Web Consortium (W3C):

Phrase elements add structural information to text fragments. The usual meanings of phrase elements are following:

EM:
Indicates emphasis.
STRONG:
Indicates stronger emphasis.
CITE:
Contains a citation or a reference to other sources.
DFN:
Indicates that this is the defining instance of the enclosed term.
CODE:
Designates a fragment of computer code.
SAMP:
Designates sample output from programs, scripts, etc.
KBD:
Indicates text to be entered by the user.
VAR:
Indicates an instance of a variable or program argument.
ABBR:
Indicates an abbreviated form (e.g., WWW, HTTP, URI, Mass., etc.).
ACRONYM:
Indicates an acronym (e.g., WAC, radar, etc.).

EM and STRONG are used to indicate emphasis. The other phrase elements have particular significance in technical documents.

<snip>

The presentation of phrase elements depends on the user agent. Generally, visual user agents present EM text in italics and STRONG text in bold font. Speech synthesizer user agents may change the synthesis parameters, such as volume, pitch and rate accordingly.


John

Erica C.
08-03-2006, 06:16 PM
From World Wide Web Consortium (W3C):
The presentation of phrase elements depends on the user agent. Generally, visual user agents present EM text in italics and STRONG text in bold font. Speech synthesizer user agents may change the synthesis parameters, such as volume, pitch and rate accordingly.
Yes. That's what I was wondering about. I think some people may treat EM and STRONG as substitutes for <I> and <B>. However, the correct thing to do is to use EM and STRONG for emphasis and put something like a book title in a span and assign it a style of font-style: italic.

OK. Got it.

Erica