W3C home > Mailing lists > Public > www-style@w3.org > March 2003

Re: :here for Links

From: Larry Israel <lisrael@cruzio.com>
Date: Mon, 31 Mar 2003 09:38:20 -0800
To: www-style@w3.org
Message-id: <a05010401baae254e9637@[63.249.90.13]>

> I'm not sure if it's an idea which has been brought up yet, but I think
> it would be useful to have a pseudo element called :here or something
> similar.  The purpose is to select only hypertext links link point to
> the current page.  This way, web developers don't have to go to the
> navigation device on every page and make the links have special
> classes or anything like that.

This is definately needed because the need for it is ubiquitous
(everywhere). Surely, most of you are aware that a great many web sites
have the current page styled differently in menus to show where you are.
This would likely be done on every site, if it was easier to implement.
Presently, you have to jump through some hoops to acheive it. One method
is to assign ids to each link, as described in the book Eric Meyer on CSS
(page 115) and probably elsewhere. These are basically workarounds that
accommodate for the unfortunate fact that a :current selector is not
available.

To my mind, the idea of using it for jumps within the page is a tangent.
It might be useful for that as well. The most-important and ubiquitous use
would be for the link to that page in the navbar.

Ideally, these two would even have different pseudo-classes.

>> Yes, I proposed that pseudo-class a very long time ago, named
>> :local-link or something.

> I vaguely remember that you proposed simply ':local'

How about :current ?

(The idea is not mine, although I'm happy to advocate for it. Well-known
CSS experts have proposed this, although I'm not finding a reference at
the moment.)

I would go one step further and propose that there be an easy way to have
a:current hyperlinks not be treated as hyperlinks! Usually, you don't want
visitors to click that link because it just takes them back to the page
they're viewing. When the current page appears in the navbar as a link,
visible in status bar (etc.), that makes it less clear that it's the
current page. (Some visitors think, "why would there be a link to the
current page?" The answer is "because it's too hard to author web pages
that way.")

You can go part way by using cursor: text
a#currentpageid {<color changes, etc.>; cursor: text;}
But this isn't fully the same as making the anchor act as though it is not
a link at all.

Larry
Received on Monday, 31 March 2003 12:38:46 GMT

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