Monday, September 19, 2011

HTML help!!How to change a image link when a mouse goes over it?

I'm making an webpage for my html class and i need to know if it is possible for this to happen.

1)is there a way to make an image link to the homepage and if your mouse cursor goes over it, it changes to another picture.

2)If there is a way to do this how do you write the code to make it?HTML help!!How to change a image link when a mouse goes over it?Here is the HTML Source code. I was trying to post it on here, but Yahoo Answers! wouldn't allow the full code.



http://www.mediafire.com/?2jzt19mxgceHTML help!!How to change a image link when a mouse goes over it?There are a few different ways to do this. The easiest is by creating an event handler for the anchor's onmouseover and onmouseout events to change the picture. You can also use CSS - a:hover a:link I believe are the ones you need. There are also a:visited and one other if I'm remembering correctly.





****EDIT****



Did a quick search - the last one is a:active. Make sure that they are defined in the following order

a:link

a:visited

a:hover

a:active

But you also don't necessarilly need to define them all. If you don't define them, they'll go to the defaults.HTML help!!How to change a image link when a mouse goes over it?You can do this..

simply using css.

one class with its hover class having different image.