image swap on img src hrefs

hi

i have been sucessully able to change background images on hrefs using a css a:link class

how can i get images which are hrefs to swap on mouseover.

for example - how would i apply css to change image1.jpg to image2.jpg on hovering.....


<img src="image1.jpg">
naifyboy123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PhilHowCommented:
Must use event in tag:

<img src="image1.jpg" onmouseover="this.src='image2.jpg'" onmouseout="this.src='image1.jpg'">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BonRougeCommented:
I think your talking about a rollover effect.

Have a look at this and see if it helps...

http://bonrouge.com/br.php?page=rollover3
0
BonRougeCommented:
Actually, re-reading what you said, I think PhilHow's answer's OK. Here's another page similar to the one above that has the img tags in the html, but the method is basically the same as the first one - the difference being that in the second one, the  images are shrunk by the CSS to 1px dots so that you can't see them and instead, we see the background image of the 'a' tag.
0
BonRougeCommented:
Sorry...

Here's that other page, if you're interested... http://bonrouge.com/br.php?page=rollover2
0
naifyboy123Author Commented:
thanks guys - PhilHow's answer is the easiest and lowest maintenance.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.