Jump to content


Photo

Title for anchor tags


  • Please log in to reply
7 replies to this topic

#1 Wickham

Wickham

    Advanced Member

  • Advanced Member
  • PipPipPipPip
  • 1,732 posts
  • LocationSalisbury UK

Posted 03 July 2009 - 03:59 AM

I've seen several topics about whether to use the title="..." in anchor tags and people have different views.

If I exclude the title like this:-
Contents

I presume that a screen reader for a blind person will read out "Contents", is that correct?

If I include title like this:-
Contents

all browsers show a tooltip which I find ugly, but does a screen reader read out both "Contents" and "Main contents of this website"? How can I include extra information for a disabled person without showing the ugly tooltip?

Is the best way to avoid using title but to increase the description between the and tags? That is also ugly because you get more words with the hover style which may be a different color and underlined.

There was a discussion here http://forums.site-r...anchor-carries/ where people couldn't make up their minds whether it is a good idea to have the title or not and some were thinking of SEO while others were thinking of accessibility.

Edited by Wickham, 03 July 2009 - 04:14 AM.

  • 0

#2 SunnyOne99

SunnyOne99

    New member

  • New Members
  • 11 posts

Posted 25 July 2009 - 08:24 AM

I'm in my first web development class and our instructor taught us to use titles in all of our anchor tags.
  • 0

#3 KalvinMartin

KalvinMartin

    New member

  • Member
  • 10 posts

Posted 29 February 2012 - 02:01 AM

Using link title element has become more popular since the rise of such widely used scripts as WordPress which by default duplicates the post title link in its title element. Still, despite being the common behavior, this method of using title element is both not right and annoying.
Example:
<a href=”/smater/” title=”Author’s biography”> Smarty</a>
OR
<a href=”/smater/” title=”More posts by Ann Smarty”> Smarty</a>
  • 0

#4 LSW

LSW

    Knight of the Square Cubicle

  • Moderators
  • 8,046 posts
  • LocationJuneau AK

Posted 29 February 2012 - 12:56 PM

I'm in my first web development class and our instructor taught us to use titles in all of our anchor tags.



Well remember Rule # 1 - When in doubt do whatever LSW tells you to do, he is the best thing since sliced bread.

First a reply to:

...our instructor taught us to use titles in all of our anchor tags. - SunnyOne99

Why does that not surprise me? I have yet to deal with a class that actually teaches you good coding habits, by school taught the same mistakes.

Simply ask yourself Why? Why would I want to repeat what I already have?

<a href=”whatever” title=”Cause LSW says so”>Cause LSW says so</a>

What possible argument can there be for repeating?

As for the screen readers, yes... It will read out "Cause LSW says so Cause LSW says so". Now if that would not get redundant for vision impaired users on each and every one on each and every page. So for SunnyOne, you can see the issue with adding a title to every anchor. If you are still in the class, you should point this out to the instructor and the school needs to consider covering web accessibility issues. There is no requirement for titles, they are only to be used when they have value for the user.

In the example above, is their other content than the Main Content or would not Content imply the main content? If there is another secondary content, it would likely be in side bar or sub-box in which I would still expect Content to be main content and something else would be Box content or side content etc.

Of course the best thing in this case is simply to say what it is, rather than "Content", why not simply state "Main Content"? Now I assume this is just for example, but the question is what is keeping me from stating what I want to say? Can't I say it clearly so I do not need to explain it further?

The issue I have with the forum comment you made is that people once again do not understand that there is no SEO vs Accessibility, they are the same thing. SEO is optimizing for a SE spider, a "machine" that records pages and contents. It is as blind as many disabled users. If you optimize a site for special needs users, especially the vision impaired, then at the same time you are optimizing for the blind machine you want to make life easy for. Just remember folks that you are building web sites for the user, the human. They have to be able to use it. No. 1 ranking is of no use of the user arrives and can't easily find what they want. People are the priority and not machines. But anything done to make the site easier to use for humans will make it better for the machines and up your ranking.

So no, you should never use the title attribute unless it is NEEDED to better clarify a target that you cannot clarify in the actual anchor text.

As a side note to it's cousin alt=" ", the alt attribute should always be present for every image, but left empty if just for decoration. This will indicate to the screen reader user that there is an image but it is of no importance. If you do not use the alt attribute the screen reader may (depends on age and user preference) read the name of the image "ksikodjsk.jpg" which is as irritating as anything. So always use the alt attribute, even when empty & at least use decent names for images so they get "image topLeftCorner JPG" rather than "image ksikodjsk jpg".

The alt attribute is for passing along information the user cannot get visually. So "image LSW recieving the 'What a good guy' award from President Obama" instead of "image ksikodjsk jpg" or "image Bar chart showing 56% increase this year compared to 43% increase last year for this quarter" instead of "image ksikodjsk jpg"

Both the alt and the title attributes are really simple to use once one considers what they are for and who they are for. Once again a spider will get more out of an alt attribute than an image file name, so accessibility for the impaired user is accessibility for the spider hence SEO.

So to finish off my usual seminar length post: Titles. If you have an :image title" under (or wherever) the image that says "LSW recieving the 'What a good guy' award from President Obama", you do not need to use it in an alt attribute or the user will here "LSW recieving the 'What a good guy' award from President Obama image LSW recieving the 'What a good guy' award from President Obama." If your content is rather clear that I received and award from President Obama, you can cut the alt or image title back to "LSW recieves award".

So I strayed a bit off, but only because title and alt are much the same and both can result in irritating repeats for screen reader users or repetitive tool tips. Understanding one helps understanding the other.

Posted Image Disclaimer: If you do not know me, this was with humor and not arrogance.
  • 0

Thank You, Migwetth, Gunalche’esh, Ha’w'aa, Danke
 

"There are 3 types of people: Those who can count and those who cannot."

 


#5 Andrea

Andrea

    Advanced Member

  • Moderators
  • 5,731 posts
  • Facebook:https://www.facebook.com/aandbwebdesignAB
  • LocationSan Antonio, TX

Posted 29 February 2012 - 01:45 PM

What possible argument can there be for repeating?


Well, the original posts are from 2009 - maybe he thought we forgot? :P
  • 0

#6 LSW

LSW

    Knight of the Square Cubicle

  • Moderators
  • 8,046 posts
  • LocationJuneau AK

Posted 29 February 2012 - 05:09 PM

Posted Image

I guess I am Chronologically challenged...

Reminder to self: Check dates, check dates, check dates
  • 0

Thank You, Migwetth, Gunalche’esh, Ha’w'aa, Danke
 

"There are 3 types of people: Those who can count and those who cannot."

 


#7 Andrea

Andrea

    Advanced Member

  • Moderators
  • 5,731 posts
  • Facebook:https://www.facebook.com/aandbwebdesignAB
  • LocationSan Antonio, TX

Posted 29 February 2012 - 05:51 PM

Posted Image
I guess I am Chronologically challenged...


At least that sounds one heck of a lot better than 'mentally damaged'... :raised:
  • 0

#8 LSW

LSW

    Knight of the Square Cubicle

  • Moderators
  • 8,046 posts
  • LocationJuneau AK

Posted 01 March 2012 - 11:10 AM

Defective my dear, I am Mentally Defective... Damaged would suggest I was "Normal" at one time (as if I could ever pass for normal ROFL). Mentally Defective would suggest we are all defective at birth.

If we are to be stigmatized, then you should at least use the politically incorrect correct stigmatizing terminology as put forth by the Federal Government.

I would like to be disrespected with respect please.... Posted Image

Now if you will excuse me those nice fellows with the coat are waiting for me, talk about defective, they keep bringing me jackets with sleeves tat are far to long and tell me not to quit my day job for a comedian career.

I just bust my-selves up.

Good morning Luv!
  • 0

Thank You, Migwetth, Gunalche’esh, Ha’w'aa, Danke
 

"There are 3 types of people: Those who can count and those who cannot."

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users