[whatwg] [html5] 2.6.1. The a element

Ian Hickson ian at hixie.ch
Tue Apr 12 13:02:44 PDT 2005


On Tue, 12 Apr 2005, Christoph Päper wrote:
> > 
> > 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>
> 
> 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'.

Fair enough. I will update the spec.


> (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.)

You want the new <navigation>. (<menu> is for things like context menus 
in the current draft for HTML5.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list