Skip to: Navigation | Content | Sidebar | Footer


Weblog Entry

acronym vs. abbr

January 03, 2004

Pedantry aside, I’m going to be kicking myself in a few years when I have to strip all the incorrect <acronym> tags that litter my code today.

(To the curious: debates rage over the finer differences between <acronym> and <abbr>. Technically, you should be using <abbr> in most cases, except that MSIE doesn’t support it, which means your work is going to waste. Then there’s the accessibility side of things, which says that your good intentions in at least providing something to IE users is actually causing harm on the screenreader end of things. And there’s the code issue which says you’re using the wrong element to get the job done, which is a hack and will result in the scenario I began with. And finally there’s the main accessibility bugbear which suggests the common screenreaders don’t support either yet anyway. And all this over two seemingly redundant tags. Oy.)


Reader Comments

Neil T. says:
January 03, 01h

Interesting - I’ve been using Brad Choate’s MTMacro plugin for acronym expansion - http://www.bradchoate.com/past/mtmacros.php . But then I’m also one of those annoying teenagers who has to put smiley faces in amongst their entries, and naturally graphical smileys are far better than textual ones. Which probably opens up a whole new accessibility can of worms…

Lenny says:
January 03, 02h

The overwhelming majority of web traffic is via MSIE. (http://www.google.com/press/zeitgeist_nov03.html ) Using abbr over acronym for screen readers beats the purpose of having used acronym over abbr previously: to cater to the IE user. XHTML 2 completely removes acronym because it is a useless tag–an acronym is a type of abbreviation and the distinction is usually missed (most, including I, refer to initialisms as acronyms)–the only reason I still use acronym is IE, and I do not plan on sacrificing accessibility for the majority of my readers.

Lach says:
January 03, 07h

If you’re going to correct the markup further down the line, why not use markup right now to aid with Really Bloody Easy substitution further down the line

[acronym title=”WhatEver” class=”abbr”]we[/acronym]

?

nick says:
January 03, 11h

You could just never abbreviate anything ever again. That seems like the safest route.

January 03, 11h

In that blog entry of mine that you cite, I do point out a few salient things:

1) There’s a javascript hack to get IE to support <abbr>. It seems to work fine.

2) JAWS 4.51 *does* support both <abbr> and <acronym>.

3) If you’ve been hard-coding <acronym>s, into your content, you’ve probably been wasting your time.

Dave S. says:
January 03, 12h

Jacques, I’m inclined to think the script hack is the best route. Given that deleting an external script and a single line of code is the path of least resistance if/when the issue becomes moot, it’s probably the best payoff/workload ratio.

WAI wants <acronym>/<abbr> though, so sometimes hard-coding is the only way.

January 03, 12h

“WAI wants <acronym>/<abbr> though, so sometimes hard-coding is the only way.”

I was suggesting, wherever possible, to let your CMS handle them.
In MT, of course, there’s (my patched version of) Henrik Gemal’s plugin.

Tony says:
January 04, 12h

Why not use abbr for validity/accessibility, and use the IE hack for IE users? Here’s a script on Photomatt that was written to automatically insert acronym tags: http://photomatt.net/scripts/acronymit

It would be easy to change it to 1) insert abbr tags instead, and 2) change the span to class=abbr, so that IE users can have the same benefit.

This would automate the process (and you can add as many additional abbr’s as yo want), would be XHTML Strict compliant, symantically correct, work with screen readers, and give IE users the visual benefit as well…

Of course, you could do the same thing by hand if you want.

ex: [abbr title=”HyperText Markup Language”][span class=”abbr” title=”HyperText Markup Language”]HTML[/span][/abbr]

Then just style away to your heart’s content…

abbr, acronym, span.abbr {
cursor: help;
border-bottom: 1px dashed #000;
}

There’s also another javascript hack that does the replacement on existing abbr tags, rather than looking for the text itself:
http://www.sovavsiti.cz/css/abbr.html

There’s also a very interesting custom HTML element javascript that essentially *adds* the tag to IE:
http://www.jasonkarldavis.com/scripts/abbrhack/

Bottom line (for me), I use abbr always because it’s always correct…acronym is most often misused. I haven’t implemented any of the above hacks yet, but it’s coming this weekend…

David says:
January 05, 09h

I would agree that:

1. IE is very annoying on this point.
2. I let the CMS handle as much of it as I can - often through the use of macros.
3. I attempt to use ABBR and ACRONYM correctly, even though #1 is still true. I handle this by implementing a policy I first heard at work.

- Spell it out completely the first time and place the acronym or abbreviation in paratheses behind this.
- Then I enclose the abbreviation/acronym with the appropriate tags.

Both of these steps are handled by the CMS when I place the abbreviation/acronym in my entry.

January 25, 02h

After thinking about this problem for a little while, I decided on a compromise that will keep code semantically correct and standards compliant, fudges abbr for IE, and can link to a definition that’s better than the expanded text of the abbreviation. I posted it on my site: http://www.pulpblog.com/archives/2004/01/25/making-abbr-work-with-internet-explorer-and-making-acronym-more-useful-too/