Using photo's as links question.

Associate
Joined
3 Feb 2003
Posts
1,771
Location
Sydney, Australia
Hrmm, I'm not much up on html or for that matter anything to do with web design.

What I'd like to know is if I were to have a picture as a link, after someone's pressed it and then later on come back to my page could it show a different picture so they know they've already pressed it?

A bit like when you click on a normal hyperlink the text changes colour if you've clicked on it.

It's probably really easy and gets done all the time but I'm a bit dumb so feel free to enlighten me. :)
 
If using CSS you could give the <a> link a background image for its :link and :active state, and perhaps :hover aswell.

But for :visited, set a different background image.

Code:
<a class="foo" href="www.google.com"></a>

Code:
a.foo:link, a.foo:active, a.foo:hover {
  display: block;
  width: 50px;
  height: 10px;
  background-image: url(link/to/image.jpg);
}

a.foo:visited {
  display: block;
  width: 50px;
  height: 10px;
  background-image: url(link/to/image_visited.jpg);
}

That might need some tweaking to get it working right for your own site, but I think it should work.
 
Back
Top Bottom