SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)

    Too Much Accessibility: titles titles titles everywhere

    This is actually an old post (with a newer URL after the site got re-done), but it's worth repeating.

    Thankfully, WordPress now no longer by default adds worthless title attributes to every freaking link anymore. But old version still do!

    I've seen still too many times "SEO" given as a reason for title attributes. Know this way is pure evil. With all the potential trouble of mis-using title attributes, "doing it for SEO" almost guarantees you are, indeed, mis-using it. And so now you're supporting robots over humans.

    The article also touches on the title trick some of us try when the graphic designer insists that the link to the full article is only called "Read more".

    http://www.rnib.org.uk/professionals...ost.aspx?id=38

    Quote Originally Posted by the article
    But if a TITLE attribute exists in the hover region it will be read instead of the visible text.
    As Ryan Benson reminded me, this is one of the big bugs of ZoomText, a popular reader/magnifier.

    Quote Originally Posted by the article
    Screen magnification users: would have their access to information in an image's ALT attribute blocked by a TITLE attribute, especially, a null one.
    I'm not sure if an empty-string title attribute is still a problem, but this is certainly code we've been encouraged to use in order to stop Internet Explorer from showing alt text like a tooltip, as it tends to do (however, it should be noted users of IE have come to rely on it as additional information scent, so not sure we really need to remove alt-tooltips anyway...).

    A more updated set of recommendations for using title attributes is available at Steve Faulkner's post over at Paciello Group: http://www.paciellogroup.com/blog/20...tle-attribute/

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    I've seen still too many times "SEO" given as a reason for title attributes. Know this way is pure evil. With all the potential trouble of mis-using title attributes, "doing it for SEO" almost guarantees you are, indeed, mis-using it. And so now you're supporting robots over humans.
    The big problem I have with title attributes these days is lack of support on mobile devices. As far as I'm aware (and please correct me if I'm wrong), mobile devices don't do anything with the title attribute. That's a problem on one of my sites where I have a lot of footnotes, and although I put the notes at the bottom of the page, I also mark up the footnote reference as <abbr title="note goes here">1</abbr> to make it easier for people to find it ... and that doesn't work on mobiles

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    You'd probably have to JS it to work with some gesture, I think.

    For keyboarders with a focus you can CSS it, but not for unfocusable things like abbr.

    Off Topic:

    I just got a copy of Nielsen's Mobile Usability. It's got lots of good stuff in it, even though it's already pretty old in the fast-paced world of mobile.

  4. #4
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It gets misused by developers, under-used by browsers, and the verbosity caused by the over-use that you mentioned has done no good for its accessibility. If were not for all that, it could have been very useful; but it has been rendered near to useless instead. Not much fun trying to strip them out from Drupal's forms as well, though it has always been much more disciplined with their use than WP was.

    I never know why browser developers have not made more of it, with decent styling, keyboard access, the option to disable them, and so forth.

    I'm not sure if an empty-string title attribute is still a problem...
    Was there a particular issue with it at some point, poes?

  5. #5
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    What I meant there was, I remember this post from long ago.. someone recently re-twotted it, and this was good because I lost my bookmarked URL to the article when the rnib site did an upgrade. So it may have caused some other problem I'm not aware of that no longer happens, unless it was in fact just a reference to the title="" many of us do on images with alt to prevent IE from showing the alt like a tooltip.

    Honestly sometimes I wonder if that would have been a good idea or not, to have images on all browsers show the alt text on hover. For one thing, it would have brought the attention of bad alt text to authors. For another, we've seen IE users come to rely on it: for confirmation of something, for some extra information (when the dev put good info in the alt text that wasn't available as an image caption), or sometimes just the name of the file.

  6. #6
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it's a weird discrepancy in browser behaviour. I don't think that IE's way of doing it is right, although using a trick to hide it seems unnecessary.

  7. #7
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Hm, there's nothing in the specs about it showing up, so most devs consider it a bug.
    Or at least, undesired behaviour.

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,802
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The alternative for consistency across browsers would be to copy the alt text into the title if the title is empty - either byplacing the same content in both attributes (easily done using server side languages) of by having a couple of lines of JavaScript run to copy it across.

    Code:
    var imgs = document.getElementsByTagName('img');
    for (var i = imgs.length - 1; i >= 0; --i) {
       if ('' === imgs[i].title) imgs[i].title = imgs[i].alt;
    }
    Of course generating it in the HTML in the first place would be preferred if you are the one creating the web page in the first place since then it will work for everyone and not just those with JavaScript enabled.

    The JavaScript version would perhaps be more suited to be attached into the browser itself rather than to individual pages - adding it as a userscript into Firefox, Chrome or Opera would convert those browsers to working the same way that Internet Explorer does with the alt text being displayed when you hover the mouse over images that do not have specific title text. If attached as a userscript into IE it would reverse out theeffect of the title=""
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •