W3C home > Mailing lists > Public > www-style@w3.org > July 2002

Re: a:hover and a:active and named anchors

From: Tantek Celik <tantek@cs.stanford.edu>
Date: Thu, 25 Jul 2002 14:47:29 -0700
To: Boris Zbarsky <bzbarsky@MIT.EDU>, Jerry Baker <jerrybaker@attbi.com>
CC: Stuart Ballard <sballard@netreach.com>, www-style <www-style@w3.org>
Message-ID: <B965C001.125A5%tantek@cs.stanford.edu>

On 7/25/02 2:28 PM, "Boris Zbarsky" <bzbarsky@MIT.EDU> wrote:

> 
>> Although I might be ignorant of some other purpose of which I haven't
>> thought, why can't named anchors be specifically excluded from :hover
>> and :active?
> 
> Because CSS is markup-language-independent and thus has no concept of a
> "named anchor".  All it knows is that there is a <a> element.  Any other
> semantics are attached to the <a> by the document language, which
> happens to be HTML in this case.

Precisely.

Also, please note that named anchors are have been _removed_ from XHTML 1.1.

 http://www.w3.org/TR/xhtml11/changes.html#a_changes

So, really what you _should_ do is stop using named anchors, and use the
"id" attribute instead directly on the target element (i.e. don't use an
unnecessary <a> element at all for the destination of a hyperlink), which is
much better structurally than those empty named anchors that litter the web.

> Keep in mind that CSS is not an adjunct to HTML but an adjunct to
> XML-based markup languages in general.

Exactly.  Thanks Boris.

Tantek
Received on Thursday, 25 July 2002 17:40:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT