Re: :here for Links

> 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 UTC