W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2012

Re: title attributes on links

From: Ramón Corominas <listas@ramoncorominas.com>
Date: Mon, 28 May 2012 13:19:34 +0200
Message-ID: <4FC35F46.2080402@ramoncorominas.com>
To: Harry Loots <harry.loots@ieee.org>
CC: Steve Faulkner <faulkner.steve@gmail.com>, Glen Wallis <glen.wallis@gmail.com>, w3c-wai-ig@w3.org
Hi, Harry and all.

The code that you propose does not use a <label> to identify the <input> 
(there is no text inside the <label>, apart from the "value" that is not 
valid to give the control a name).

However, the following code does exactly the same without a visual 
label, and without the need of a title attribute:

<label for="tx-search" class="visually-hidden">Search text</label>
<input id="tx-search" type="text" value="" />
<button type="submit">Search</button>

.visually-hidden {
   position: absolute !important;
   clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
   clip: rect(1px, 1px, 1px, 1px);
   padding:0 !important;
   border:0 !important;
   height: 1px !important;
   width: 1px !important;
   overflow: hidden;

So, my concerns are:

- Why the title is GOOD for form controls and BAD for images?
- Is it anywhere in the spec that the title attribute can convey the 
accessible name for form controls but not for images?
- If this rule applies only to form controls, why is it allowed for them 
and not for other elements?
- If this rule applies to any element except images, why are images an 
- Do you consider this behaviour is consistent?

I already know what WCAG says, what I would like to clarify is why the 
title attribute works differently for different elements and where the 
specs define the difference.


Harry wrote:

> I agree that there are situations where a visual label element is not 
> appropriate.
> However, instead of  <input type=text title=search> 
> <button>search</search> (your example), why not use <label><input 
> type="text" id="search" value="search"></label><button>search</button>?
Received on Monday, 28 May 2012 11:22:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:44 UTC