Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i added a image to a link in mouseover event using

onmouseover=this.style.backgroundImage='url(/image/1.png)'

then how to remove this image on onmouseout?

Thanks
Posted

CSS
.buttonCss
{
    background: #dfeffc ;
    width:auto;
    height:auto;
    /*Add More Style As You Need*/
}
.buttonCss:hover
{
    background: #dfeffc url('YourImageUrl');
    width:auto;
    height:auto;
    /*Add More Style As You Need*/
}

Use this as follows
HTML
<a href="YourLinkHere" class="buttonCss"></a>


try this it will change background color to Image.
 
Share this answer
 
Comments
abdussalam143 27-Apr-13 4:02am    
Marks As Answer if it Help You for others help
Use CSS rules to style your HTML tags. Add a rule that will style your tag accordingly when the class "backimage" is present.
Then all you have to do is add that class to show the image and remove the class to take it away again.

Regards,
— Manfred
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900