Use of acronym and abbr tags with anchors

Discussion in 'HTML' started by Rowan Malin, May 14, 2004.

  1. Rowan Malin

    Rowan Malin Guest

    Hi folks,

    This is (I think) my first posting to this group, so please accept my
    apologies if the question is inappropriate. I'd like to know what the
    'correct' or 'preferred' approach is (if any) for defining anchor tags whose
    contents are solely abbreviations or accronyms. For example, should I write:
    <a href="x"><acronym>HTML</acronym></a>

    or:
    <acronym><a href="x">HTML</a></acronym>
    ?

    (BTW - I don't want to get into a fight over what is or is not an acronym!
    Use <abbr> if you prefer.)

    On a related note (and again, forgive me if this should be asked elsewhere),
    I notice that some browsers default-render the above with *both* underline
    and under-dottedline which, in my opinion, looks odd. What would be the
    suggestions of the group regarding the preferred suggested rendering (using
    CSS, of course)?

    Cheers,
    Rowan
     
    Rowan Malin, May 14, 2004
    #1
    1. Advertising

  2. Rowan Malin

    Neal Guest

    On Fri, 14 May 2004 00:39:14 -0400, Rowan Malin <>
    wrote:

    > I'd like to know what the
    > 'correct' or 'preferred' approach is (if any) for defining anchor tags
    > whose
    > contents are solely abbreviations or accronyms. For example, should I
    > write:
    > <a href="x"><acronym>HTML</acronym></a>
    >
    > or:
    > <acronym><a href="x">HTML</a></acronym>
    > ?


    I'd put the anchor inside any markup, but that's just me. Neither is
    wrong, but as a matter of habit I'd do it that way.

    > I notice that some browsers default-render the above with *both*
    > underline
    > and under-dottedline which, in my opinion, looks odd.


    Which browsers actually use a dotted line under abbr? Right now I have
    Mozilla 1.6, IE 6 and Opera 7.23 open and none render anything for abbr or
    acronym.
     
    Neal, May 14, 2004
    #2
    1. Advertising

  3. Neal <> wrote:

    > Which browsers actually use a dotted line under abbr? Right now I
    > have Mozilla 1.6, IE 6 and Opera 7.23 open and none render anything
    > for abbr or acronym.


    I haven't checked the situation lately, but e.g. Firefox uses a dotted
    line under both abbr and acronym if (and only if) the element has a title
    attribute.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, May 14, 2004
    #3
  4. Rowan Malin wrote:

    > <a href="x"><acronym>HTML</acronym></a>
    > or:
    > <acronym><a href="x">HTML</a></acronym>


    I'd tend to go with the former. My reasoning? Consider for example a
    browser that rendered the <acronym> element like:

    ACRONYM (Full Expansion).

    Then the two segments of code you posted would be (where [...] indicates a
    link):
    [HTML (Hypertext Markup Language)]
    and:
    HTML:
     (Hypertext Markup Language)
    
    It just seems a more logical way of doing things.
    
    But it's not really important. Either way is right. My way is just more
    right. ;-P
    
    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, May 14, 2004
    #4
  5. "Rowan Malin" <> wrote:

    > I'd like to know what the
    > 'correct' or 'preferred' approach is (if any) for defining anchor
    > tags whose contents are solely abbreviations or accronyms.


    In general, there are no rules for nesting <a> elements with other
    text-level markup.

    > For
    > example, should I write:
    > <a href="x"><acronym>HTML</acronym></a>
    >
    > or:
    > <acronym><a href="x">HTML</a></acronym>
    > ?


    Both are valid, and there is no known difference in their effects, except
    when style sheets assign properties to <acronym> in a manner that may
    conflict with the default or styled presentation of <a>.

    For example, suppose a user style sheet sets
    acronym { background: yellow; color: purple; }
    (which _might_ be sensible, for highlighting purposes
    In the first case, the background color for <acronym> hides the link
    underline and makes the link text purple, irrespectively of the state of
    the link, since it's primarily <acronym> text and takes its color
    accordingly.

    For such reasons, I have usually recommended that when <a href> elements
    are nested with other text level markup, the <a href> markup is
    innermost. This makes the presentation rules for <a href> dominant over
    other rules, which is usually good, since link presentation is essential.

    > (BTW - I don't want to get into a fight over what is or is not an
    > acronym! Use <abbr> if you prefer.)


    Well, if it is unclear whether HTML is an acronym or an abbreviation,
    what's the point of using <acronym> or <abbr> markup for it? That is,
    what is the expected _gain_ from using the markup? For example,
    do you wish to hear a speech browser try to pronounce "HTML" as a word?

    The "fight" _is_ the most relevant question. And since there is no
    consensus, there is normally no reason to use either markup, except
    perhaps in specialized cases (e.g., a special application in an intranet
    where you can explain to users what the dotted lines mean, etc.). More on
    this: http://www.cs.tut.fi/~jkorpela/html/abbr.html
    >
    > On a related note (and again, forgive me if this should be asked
    > elsewhere), I notice that some browsers default-render the above with
    > *both* underline and under-dottedline which, in my opinion, looks
    > odd.


    To the extent that the dotted underline is useful at all (which I doubt),
    it's useful also when there is a link underline. If it acts as a signal
    saying "here's an abbreviation/acronym for which some explanation is
    available if you put the cursor on it", then this would say just the same
    thing even when there's another presentational idiom saying "here's a
    link".

    However, note that if both elements have a title attribute, browsers seem
    to use just one of those attributes. For example, if you have

    <acronym title="HyperText Markup Language">
    <a href="http://www.w3.org/Markup" title=
    "HyperText Markup Language (HTML) Home Page - W3C's HTML Activity">
    HTML</a></acronym>

    then browsers that I tested now show the title of <a href> as tooltip and
    ignore the title of <acronym>. That is, they use the title of the
    innermost element. But I remember vaguely having seen the opposite
    behavior too. Anyway, there's usually no point in using title attributes
    that way, since it's better that the author decides which attribute is
    more essential. But if e.g. some HTML-generating software creates markup
    that may have nested elements with title attributes, it is generally best
    to make it put <a href> innermost for this reason too - the title of
    <a href> is usually more important and useful than other title
    attributes.

    And by not using title for <acronym> (and using it for <a href> instead)
    should avoid the problem of two different underlines.

    > What would be the suggestions of the group regarding the
    > preferred suggested rendering (using CSS, of course)?


    Technically, the dotted underline is a bottom border in CSS terms, so you
    can suggest suppressing it by using e.g.

    acronym.with-link { border-bottom: none; }

    and <acronym class="with-link" ...><a href=...>...</a></acronym>. There's
    currently no selector in CSS that would mean 'acronym elements containing
    a elements'. Contextual selectors work the other way around. If you used

    <a href=...><acronym ...>...</acronym></a>

    (despite the arguments above), then you could use simply

    a:link acronym, a:visited acronym { border-bottom: none; }

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, May 14, 2004
    #5
  6. Rowan Malin

    Rowan Malin Guest

    "Neal" <> wrote in message
    news:eek:...
    > On Fri, 14 May 2004 00:39:14 -0400, Rowan Malin <>
    > wrote:
    >
    > > I'd like to know what the
    > > 'correct' or 'preferred' approach is (if any) for defining anchor tags
    > > whose
    > > contents are solely abbreviations or accronyms. For example, should I
    > > write:
    > > <a href="x"><acronym>HTML</acronym></a>
    > >
    > > or:
    > > <acronym><a href="x">HTML</a></acronym>
    > > ?

    >
    > I'd put the anchor inside any markup, but that's just me. Neither is
    > wrong, but as a matter of habit I'd do it that way.
    >
    > > I notice that some browsers default-render the above with *both*
    > > underline
    > > and under-dottedline which, in my opinion, looks odd.

    >
    > Which browsers actually use a dotted line under abbr? Right now I have
    > Mozilla 1.6, IE 6 and Opera 7.23 open and none render anything for abbr or
    > acronym.
    >


    Thanks for the advice. Your not seeing the dotted line puzzles me - I see it
    on both Mozilla 1.4 and Opera 7.23 (on Linux), but not on IE 6.
     
    Rowan Malin, May 14, 2004
    #6
  7. Rowan Malin

    Rowan Malin Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns94E96C7D89BAAjkorpelacstutfi@193.229.0.31...
    > "Rowan Malin" <> wrote:
    >

    [snip]
    > > For
    > > example, should I write:
    > > <a href="x"><acronym>HTML</acronym></a>
    > >
    > > or:
    > > <acronym><a href="x">HTML</a></acronym>
    > > ?

    >
    > Both are valid, and there is no known difference in their effects, except
    > when style sheets assign properties to <acronym> in a manner that may
    > conflict with the default or styled presentation of <a>.
    >

    [snip]

    Thanks for the detailed reply. I think I now have enough facts to make an
    informed decision.

    Cheers,
    Rowan
     
    Rowan Malin, May 14, 2004
    #7
  8. Rowan Malin

    Neal Guest

    On Fri, 14 May 2004 06:49:59 +0000 (UTC), Jukka K. Korpela
    <> wrote:

    > Neal <> wrote:
    >
    >> Which browsers actually use a dotted line under abbr? Right now I
    >> have Mozilla 1.6, IE 6 and Opera 7.23 open and none render anything
    >> for abbr or acronym.

    >
    > I haven't checked the situation lately, but e.g. Firefox uses a dotted
    > line under both abbr and acronym if (and only if) the element has a title
    > attribute.
    >


    And apparently that was the flaw in my experiment. Seems even title=""
    won't get the rendering, but an actual value will.
     
    Neal, May 14, 2004
    #8
  9. On Fri, 14 May 2004 00:39:14 -0400, Rowan Malin <>
    wrote:

    > This is (I think) my first posting to this group, so please accept my
    > apologies if the question is inappropriate. I'd like to know what the
    > 'correct' or 'preferred' approach is (if any) for defining anchor tags


    I found this article helpful:

    ABBR and ACRONYM are for user agents not for end users
    <http://www.smackthemouse.com/20040108>

    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
     
    Foofy (formerly known as Spaghetti), May 14, 2004
    #9
  10. Rowan Malin

    Rowan Malin Guest

    "Foofy (formerly known as Spaghetti)" <> wrote in
    message news:eek:...
    > On Fri, 14 May 2004 00:39:14 -0400, Rowan Malin <>
    > wrote:
    >
    > > This is (I think) my first posting to this group, so please accept my
    > > apologies if the question is inappropriate. I'd like to know what the
    > > 'correct' or 'preferred' approach is (if any) for defining anchor tags

    >
    > I found this article helpful:
    >
    > ABBR and ACRONYM are for user agents not for end users
    > <http://www.smackthemouse.com/20040108>
    >
    > --
    > Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


    Fascinating reading, thanks very much. Now I'm much better informed, and
    much less sure of what to do!

    Cheers,
    Rowan
     
    Rowan Malin, May 14, 2004
    #10
  11. On Fri, 14 May 2004 13:12:24 -0400, Rowan Malin <>
    wrote:

    > Fascinating reading, thanks very much. Now I'm much better informed, and
    > much less sure of what to do!


    I would just use the method he uses, it's the same method used in books
    and magazines and newspapers etc. Besides, it looks better when the page
    is printed, and many users don't understand that they can hover the mouse
    over it to see what it is. What about browsers where users simply can't do
    that anyway, like PDA browsers and the like. It's a very simple rule: just
    define rare acronyms (or ones the user is not expected to know, so for
    beginners) in parenthesis alongside the acronym.

    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
     
    Foofy (formerly known as Spaghetti), May 14, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred
    Replies:
    2
    Views:
    594
    Toby A Inkster
    Jul 17, 2003
  2. Steven

    <abbr> = <acronym>?

    Steven, Dec 10, 2003, in forum: HTML
    Replies:
    37
    Views:
    1,280
    Mark Parnell
    Dec 28, 2003
  3. kayodeok
    Replies:
    13
    Views:
    638
    Mark Parnell
    Mar 1, 2004
  4. Marcus Stollsteimer

    <abbr> and <acronym>

    Marcus Stollsteimer, Feb 13, 2006, in forum: HTML
    Replies:
    44
    Views:
    1,565
    Neredbojias
    Feb 18, 2006
  5. dnn
    Replies:
    8
    Views:
    1,011
    Alan J. Flavell
    Apr 19, 2006
Loading...

Share This Page