Saturday 4 June 2011

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

I%26#039;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?|||Here is the HTML Source code. I was trying to post it on here, but Yahoo Answers! wouldn%26#039;t allow the full code.





http://www.mediafire.com/?2jzt19mxgce|||There are a few different ways to do this. The easiest is by creating an event handler for the anchor%26#039;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%26#039;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%26#039;t necessarilly need to define them all. If you don%26#039;t define them, they%26#039;ll go to the defaults.|||You can do this..


simply using css.


one class with its hover class having different image.