Can I use the CSS :visited pseudo class on 'wildcard' links?

Posted by rabidpebble on Stack Overflow See other posts from Stack Overflow or by rabidpebble
Published on 2010-03-21T17:11:41Z Indexed on 2010/03/21 17:21 UTC
Read the original article Hit count: 309

Filed under:
|
|
|
|

Let's say I have a site with multiple links as follows:

www.example.com/product/1
www.example.com/product/2
www.example.com/product/3

I also append tracking info to links from time to time so that I can see how my site is being used, e.g, if somebody visits the products page from the product browser I would set a ref parameter:

www.example.com/product/1&ref=pb
www.example.com/product/2&ref=pb
www.example.com/product/3&ref=pb

The problem with this is that if the user visits a link of the first type and then views a link of the second type then the :visited pseudo class doesn't seem to apply because the browser only seems to match on exact URLs. Is there any way to have "wildcards" apply to links in this sense, so that when the user sees either the first type or the second type of link that it is highlighted?

Note: I cannot change this "ref" architecture; it is inherited.

© Stack Overflow or respective owner

Related posts about css

Related posts about css-selectors