-3

I have code like this http://jsfiddle.net/enr54x1z/
And when hovering, I want

  • to change table cell background color to #317EAC
  • to change text to white color
  • change cat image to another image

Please HELLPPPP

Narek
  • 33
  • 6

2 Answers2

1

http://jsfiddle.net/enr54x1z/3/

In order to change the picture you have to remove the img tag and replace it with a div that has a background-image

the td:hover in the CSS is activated once you hover over the <td> element. Thus the following background color is applied on hover.

td:hover{
    background-color:#317EAC;
}

You can extend this to apply other CSS styles when this element is being hovered over. With the following, once the <td> is hovered, we go to a child element and apply the color change CSS.

td:hover p{
  color:white;
}

The same method is used to change the picture on hover:

td:hover .img-block {
  background-image:url("http://www.vetprofessionals.com/catprofessional/images/home-cat.jpg");
}
Alexei Darmin
  • 2,079
  • 1
  • 18
  • 30
0
 <style type="text/css">
     .imgBox { 
    width: 191px; 
    height: 191px; 
    background: url(image-url) no-repeat; } 

    .imgBox:hover 
    { width: 191px; height: 191px; background: 

    url(other-image-url) no-repeat; } 
    </style>

//your markup can be a div inside your td
    <div class="imgBox"> 
    </div>

On image-hover u need to simply give another url of a image!

Here is an example of what you want!

Abhishek Ghosh
  • 2,593
  • 3
  • 27
  • 60