W3C home > Mailing lists > Public > www-style@w3.org > May 2014

Re: Self-referential link pseudo-class

From: Dave Kok <email@davekok.nl>
Date: Wed, 07 May 2014 11:45:38 +0000
To: <www-style@w3.org>
Message-ID: <469b1c4a1d4d780ef716f32915795da4@mail.mxes.net> (sfid-20140507_114549_708712_EC96D0A7)
Preferably this pseudo-class would also be triggered for named anchors,
<a name="foobar"></a> when the name is in the hash of the URL.

Personally I would like a more descriptive pseudo-class name more
specific to this context. current and self could be used in many
contexts. Perhaps current-uri or something like that.

On Wed, 07 May 2014 09:59:17 +0100, Antony Kennedy wrote:
> Hello.
>
> It’s a common issue to try to figure out how to specifically style
> the link that points to the current URL, for example, in a navigation
> list:
>
> <ul>
> 	<li><a href=“/“>Home</a></li>
> 	<li><a href=“about“>About us</a></li>
> </ul>
>
> Typically this is dealt with by adding class=“active” or something
> similar to the link that points to the current URL, or by removing 
> the
> link altogether, but there is no standardised practise for
> self-referential links.
>
> What does everyone think of something like :current or :self as a
> anchor pseudo-class to easily style links that point to the current
> URL?
>
> This should ignore hashes appended to the location, but probably not
> querystrings etc.
>
> I’d love to hear everyone’s opinion.
>
> Thanks,
>
> AK
Received on Tuesday, 13 May 2014 16:10:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:27 UTC