SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: link text same as title text ?

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    link text same as title text ?

    hi

    let's say I have an <A> tag:
    HTML Code:
    <a href="mysite.com/blue-pens.html title="blue pens">Blue Pens</a>
    is it ok that the "blue pens" text of link (not inside the <A> tag) is the same as the "title" property of the <A> tag ?
    is that what I'm suppose to use the "title" property or is there a better use for it ?

    thanks

  2. #2
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    19,896
    Mentioned
    216 Post(s)
    Tagged
    2 Thread(s)
    You don't need a title there at all. The text explains what the link is for, so the title text is nothing more than an annoyance.

  3. #3
    Robert Wellock silver trophybronze trophy
    SitePoint Award Recipient xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,238
    Mentioned
    51 Post(s)
    Tagged
    0 Thread(s)
    In post #1 that is an example of duplicated text content (not wise) and thus using the 'title' attribute is redundant and counter-productive in this case having: 'blue pens, blue pens' makes no sense; the link already says "blue pens" . The 'title' attribute can be used to briefly describe the contents of the link much like an annotation.
    };-) http://www.xhtmlcoder.com/
    Thinking Web: Voices of the Community

    > March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    ... The 'title' attribute can be used to briefly describe the contents of the link much like an annotation.
    can you please give an example of a text that will make good use of the "title" in this case ?

  5. #5
    Robert Wellock silver trophybronze trophy
    SitePoint Award Recipient xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,238
    Mentioned
    51 Post(s)
    Tagged
    0 Thread(s)
    You'd most likely see title attributes applied to abbreviations, if they weren't written out in full, i.e. WWW: <abbr title="World Wide Web">WWW</abbr> regarding links usually they shouldn't be needed as the link usually should be self-explanatory.

    Though sometimes where space is limited in a navigation bar; <a href="mailto:example@example.com" title="Contact the XYZZY Manager via E-mail">Contact</a> might be easier to understand than just the link that may trigger an email client, etc. That wasn't a good example though should give an idea. Recently we had a thread with how some AT devices handle the attribute: Too Much Accessibility: titles titles titles everywhere.
    };-) http://www.xhtmlcoder.com/
    Thinking Web: Voices of the Community

    > March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

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
  •