Tuesday, October 25, 2011

How do i make image links that change when the mouse hovers over them in html?

i know how to make a linked image in html but i wanted to know how to make them change from one image to another when the mouse hovers over them.How do i make image links that change when the mouse hovers over them in html?Plain (no link)



%26lt;img src=%26quot;image1.gif%26quot; onmouseover=%26quot;this.src='image2.gif'%26quot; onmouseout=%26quot;this.src='image1.gif'%26quot; alt=%26quot;%26quot;%26gt;



As a Link:

%26lt;a href=%26quot;http://Google.com/%26quot; title=%26quot;Google%26quot;%26gt;%26lt;img src=%26quot;image1.gif%26quot; onmouseover=%26quot;this.src='image2.gif'%26quot; onmouseout=%26quot;this.src='image1.gif'%26quot; alt=%26quot;%26quot;%26gt;%26lt;/a%26gt;





RonHow do i make image links that change when the mouse hovers over them in html?You're welcome. Thank you for BA.



Ron

Report Abuse

How do i make image links that change when the mouse hovers over them in html?You can use the hover property of the link and change the background image. You would have to use the link's CSS normal state first for when it is first shown or when the mouse is not hovering over it.