How can I get one image to change to another one when someone hovers over the first image? What kind of CSS code do I use? For example, say I created menu buttons for my site and wanted the buttons to change in colour when hovered over. How can I do this? Any help will be highly appreciated.
This is the code I use: In that example, the image is a link, and has a set and hover over image as well.
You could set the menu buttons to block and then have them change on hover for example: menu li a { display:block ; background-colour:#000;} menu li a:hover { display:block ; background-colour:#FFF;} I haven't tested it on images to be honest but i know it works for background colours.
thats a bunch of code man its pretty easy. dont you have Dreamweaver or you can use a text editor like note pad to do it . but for saty sake you can use dreamweaver probbly Firworks because it does it perfectly
What? menu li a { display:block ; background-colour:#000;} menu li a:hover { display:block ; background-colour:#FFF;} will work fine!
Thanks for the responses, guys. However, I think I confused everyone with my above example. I don't want just the colour to change when an image is hovered over; I want the complete image to change to another of exactly the same proportions. I think Meaghannf's response was the closest to what I'm looking for, but I don't understand the code that s/he presented: Where do I put the first image's source and the second image's source? And is all of that code really required? It looks like a whole lot of code for such a simple function! Does anyone know how to do it with simple CSS?
Sorry for the confusion, I just cut and paste my source code. Let me see if I can clarify a little: The ONLY things in that code you change are OriginalImage.IMG and MouseOverImage.IMG to the correct image paths. Yeah, I realize what I said before was completely unhelpful. Sorry, this should be better .
Thanks, Meaghannf! I appreciate your clarification. I will try your code and see what happens. And thank you to everyone else that contributed.