tags:

views:

55

answers:

4

Given that acronym is removed in HTML 5, how does one get standards support with similar functionality? Every other removed tag looks like CSS can do it, but that one seems to be removed completely...

+3  A: 

Just use <abbr> instead. That's what the spec says now:

The abbr element represents an abbreviation or acronym, optionally with its expansion.

If you want to be specific with your semantics, perhaps adding class="acronym" would do the trick. I think that's as far as you can go.

BoltClock
How could you do what acronym does with CSS?
Billy ONeal
Hmmm, on second thought I guess not since `<acronym>` isn't a purely-presentational element. A class would still be useful though if you want to be very semantic.
BoltClock
@Billy: `<acronym>` in HTML 4 doesn’t “do” anything other than indicate the author thinks the content is an acronym. I believe it was removed from HTML5 because most people don’t understand what an acronym is. (Which, for the record, is “a word formed from the initial letters of other words (e.g. radar, laser)”, according to Dictionary on my Mac. I think a lot of people used it for thing like HTML, which are actually — again, as per Dictionary on my Mac — initialisms.)
Paul D. Waite
@Paul: It also causes mouse hovering over the `acronym`'ed content to display a tooltip when someone hovers on it with the mouse.
Billy ONeal
@Billy: it’s not the `<acronym>` tag that causes a tooltip to be displayed, it‘s the presence of the `title` attribute on the tag, e.g. `<abbr title="This text will be displayed in a tooltip by most browsers">`. This works on pretty much any tag.
Paul D. Waite
@Paul: Oh. Didn't know that either. So you could just as simply put that on a `span` tag and all would be well?
Billy ONeal
@Billy: Exactly. The only difference being `abbr` and HTML 4 `acronym` do have semantic meaning, as opposed to `span` which has none :)
BoltClock
@Billy: yup, you’d still get the tooltip, but you’d no longer be indicating to e.g. screen readers that the text is an abbreviation. (One could imagine that screen readers would be able to make a better guess at pronunciation if they knew the text was an abbreviation; I’ve no idea if any screen readers actually use this information in practice.)
Paul D. Waite
+2  A: 

I thought <abbr> replaced <acronym>?

http://www.html-5.com/tags/abbr-tag/

handsofaten
+2  A: 

Can you clarify exactly what you're trying to make it look like? The default style for <acronym> differs across browsers. Opera uses a dotted underline and Chrome doesn't style it all, for example. Are you trying to emulate a particular browser's default style?

However, if you mean the tooltip-style message that appears on mouse hover, you should be able to use the same attribute in <abbr> as before: title="your acronym's definition".

misterkeg
Yes, I meant the tooltips.
Billy ONeal
+2  A: 

The acronym element was folded into the abbr element, because

  1. most HTML authors didn't know the difference between an acronym and an abbreviation and thus used them wrongly and
  2. for the use cases of those two elements, the difference between an acronym and an abbreviation are irrelevant anyway.
Jörg W Mittag
Except that IE6 doesn't support abbr :( Good thing we're not supporting IE6 anymore! :)
Billy ONeal
@Billy: Not like IE6 supports HTML5 either :)
BoltClock
@Bolt: touché :)
Billy ONeal