954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

CSS help with image links

Here is a current page I am working on http://www.russabbott.com/VERSION_2/tattoo.html I would like to change the color of the borders on my image links but cant seem to figure it out on my own. I'm sure its something easy that I am messing up. To do this with text, i would use something like this.

a:link {
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: #D00000;
}
a:active {
	color: #000000;
}

Can anyone help point me in the right direction? thanks

Mr.Furious
Newbie Poster
5 posts since May 2004
Reputation Points: 10
Solved Threads: 0
 

They seem to be working, for me, in FireFox. When I rollover, the black border turns red.

To answer your question, though, give all images the same class, with the CSS looking something like this:

.myImages {border:1px; border-thickness: 1px; border-color: #000; border-style: solid;}

Then, you can use CSS to cascade that definition to hyperlinks:

a:hover, a:active {color: #fff;}

a:hover .myImages,
a:active .myImages {border:1px; border-thickness: 1px; border-color: #fff; border-style: solid;}

Now, the border of your image links will turn red on hover or active.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

It does work in FireFox but IE6 doesn't like it

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You