W3C home > Mailing lists > Public > www-style@w3.org > October 2006

Re: [selectors] New pseudo-class proposal: ":current"

From: Alastair Campbell <ac@alastc.com>
Date: Thu, 12 Oct 2006 14:21:40 +0100
Message-ID: <452E4164.3040100@alastc.com>
To: Matthew Raymond <mattraymond@earthlink.net>
CC: W3C CSS <www-style@w3.org>

Matthew Raymond wrote:
> you'll want to
> indicate which link points to the current page. 

I'd rather this was not used, partly because it promotes what I consider
bad practice:
http://alistapart.com/articles/whereami
The bit that talks about: "Never, ever link to the page you’re on". [1]

To get the same or similar effect for the current page, I would use a
strong (or span) for the current page instead of a link.

E.g:

<ul id="nav">
  <li><a href="page.html">Another page</a</li>
  <li><strong>Current page</stong></li>
</ul>

you can build up the same styles for each:

#nav a, #nav strong { /* styles */}

And then make a small alteration for the strong:
#nav strong { color: #000; }

The advantage of :current would be that you don't need to change the
markup, however, I think there are a few situation where it wouldn't
work that would be confusing for the user. E.g. when within page links
are used (e.g. http://example.com/page.html#content), and Daniel's
point. (I think there may be other situations?)

Given it would not work consistently, you would probably find you
wouldn't want to use it for usability reasons.

Kind regards,

-Alastair

1. For other sides to the argument:
http://www.thepickards.co.uk/index.php/200608/self-referential-links-controversy-rumbles-on/
Received on Thursday, 12 October 2006 13:21:58 GMT

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