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

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 UTC