...

View Full Version : Changing Image Color



DvdBonan
07-07-2011, 04:21 PM
Hi there,

can anyone help with a code to change an image from one color to the next? I have the two images. The first is black the second is white. I want the black one to be always showing but when you put your mouse over the image it changes to the white one. I think its called hover over or something like that?

alykins
07-07-2011, 04:34 PM
:hover
so if you have two classes
.blah
.hah
you can do .blah:hover .hah{}
*note my syntax may be skewed bc im spoiled and VS fixes it for me :D

wojo1086
07-07-2011, 05:12 PM
If you give your image a class, like class="image1", then the css code would be image.image1:hover {background-image: url("images/image2.png");}

This is the only way I know how to do it off the top of my head. For hover effects I usually put image1 in a div and then give that div a background-image of image1. This is so I can easily have the hover effect I just showed you.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum