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

Self-referential link pseudo-class

From: Antony Kennedy <antony@silversquid.com>
Date: Wed, 07 May 2014 09:59:17 +0100
Message-id: <D8035D70-F65F-4A09-A9FE-731C27EAD029@silversquid.com>
To: www-style list <www-style@w3.org>

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:

	<li><a href=“/“>Home</a></li>
	<li><a href=“about“>About us</a></li>

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.


Received on Wednesday, 7 May 2014 08:59:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:42 UTC