Re: :here for Links

On 29 Mar 2003 at 11:27, Chris Vincent wrote:

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

That can already be done with CSS3 Selectors. The selector a[href^="#"] would 
select all links that begin with "#" and hence point to the current page.
If the author uses the practice of using just "#" as a placeholder for links 
manipulated by a scripting language then a[href^="#"]:not([href="#"]) would 
have the rule avoid them if desired. The only advantage I can see to using 
something like :here would be if on the page there were links that 
incorporated part or all of the path as well as the #id part, then :here would 
presumably also select them. However that would be a decision on the part of 
the web author to include the nonessential part of the URI. Since such a 
decision would seem to indicate a desire to emphasize that the link will 
always be in that place as opposed to that the link will always be on this 
page, it is a limitation I can live with. I think it can be safely said that 
there is no need for a :here pseudo-class

Received on Sunday, 30 March 2003 12:55:33 UTC