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

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 UTC