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

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

From: Orion Adrian <orion.adrian@gmail.com>
Date: Thu, 12 Oct 2006 08:14:37 -0400
Message-ID: <abd6c8010610120514x3b532cf9gad005c3d1450b459@mail.gmail.com>
Cc: "W3C CSS" <www-style@w3.org>

While you may get some resistance on the name, I love the idea.

Orion

On 10/11/06, Matthew Raymond <mattraymond@earthlink.net> wrote:
>
>    If you have a list of hyperlinks you're using for navigating a
> website, and this list is identical for all pages, you'll want to
> indicate which link points to the current page. One way to do this is to
>  put a |class| attribute on the element for the hyperlink that links to
> the current page:
>
> | <ul>
> |   <li>
> |     <a class="currentpage" href="home.html">Home</a>
> |   </li>
> |   <li>
> |     <a href="products.html">Products</a>
> |   </li>
> |   <li>
> |     <a href="services.html">Services</a>
> |   </li>
> |   <li>
> |     <a href="contacts.html">Contacts</a>
> |   </li>
> | <ul>
>
>    Such markup would require you to edit all pages in the list of
> hyperlinks. Alternatively, you could use Javascript to add the |class|
> attribute, but that requires additional programming skill that not
> everyone is capable of. It would be far simpler to have a pseudo-class
> that could select the <a> element that links to the current page:
>
> | a:current { background-color: white; }
> | a:current:hover { text-decoration: none; }
>
>    A pseudo-class like this should be no harder to implement or more
> expensive than :target. Any thoughts on this?
>
>
Received on Thursday, 12 October 2006 12:14:45 GMT

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