SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: abbr title

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    abbr title

    Hi!

    When I put a 'space' in <abbr title> (used for tooltip), it is not renedered. It just renders the text (which is before the 'space'). So the tooltip for the foloowing is rendered as ('Short)

    <td rv="SS" class='text '><abbr title=Short Sale><font color ='black'>SS</abbr></td>.

    However, when I take out the space
    <td rv="SS" class='text '><abbr title=ShortSale><font color ='black'>SS</abbr></td>

    the tooltip is rendered as 'ShortSale'.
    But, I do want a space i.e. (it should display 'short sale'). Help!!

  2. #2
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,068
    Mentioned
    253 Post(s)
    Tagged
    5 Thread(s)
    Shouldn't your text be quoted? i.e.
    Code:
    <abbr title="Short Sale">
    Take plenty of exercise walk round and round the garden
    or
    sign up now for the Isle of Jura 10K or Half Marathon!

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It is STRONGLY recommend you put attribute values in quotes in HTML 4.01, although the formal rules allow the omission of the quotes in some 'rare cases'. In XML and XHTML quotes are always required.

    Quote Originally Posted by http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2
    In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them.
    Therefore within HTML 4.01 <br title=FrobozzMagic> would be CORRECT but <br title=Frobozz Magic> INCORRECT obviously within XHTML you MUST quote the attribute value. In other words always use: <abbr title="Short Sale">...</abbr> which is the best and safest way.

    Even when not in doubt, quote anyway!

  4. #4
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,269
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I hate abbr, because it leaves keyboard-users in the dark.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,105
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    I hate abbr, because it leaves keyboard-users in the dark.
    Presumably that will change as devices catch up, though?
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  6. #6
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all. Encapsulating it with "" worked.

  7. #7
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,269
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by ralph
    Presumably that will change as devices catch up, though?
    They had over 10 years to catch up. I'm not optimistic.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •