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
I have code like this http://jsfiddle.net/enr54x1z/
And when hovering, I want
Please HELLPPPP
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");
}
<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!
color in td:hover
– Narek Mar 29 '15 at 18:08