W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2005

[whatwg] [html5] 2.6.1. The a element

From: Christoph Päper <christoph.paeper@tu-clausthal.de>
Date: Tue, 12 Apr 2005 21:34:17 +0200
Message-ID: <opso4wnfonofh7fl@crissov.heim4.tu-clausthal.de>
*Ian Hickson <ian at hixie.ch>*:
>
> So what does an <a> element with no href="" represent? Nothing? Or I  
> guess we could make the href="" attribute required.

I frequently use and advice to do navigation lists like this:

   <div><map id="nav"><ul>
     <li><a href="/">Home</a></li>
     ...
     <li><a>Current page</a></li>
     ...
     <li><a href="/contact/">Contact</a></li>
   </ul></map></div>

(I use 'map', because 'menu' is deprecated, and 'div', because in HTML4S  
'map' cannot be a child of 'body'---but let's not get distracted.)

The current page should not link to itself, but for consistency (and  
styling) I like to keep the 'a' element instance, just without an 'href'  
attribute. Elsewhere I also use 'a' instead of 'span', because it's IMHO  
equally meaningful, but shorter. So, no, I don't think 'href' should be  
required for 'a'.
Received on Tuesday, 12 April 2005 12:34:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:22 UTC