I am trying to achieve a hover effect on a table row and I have the following code on my css.
.datatable tr.row:hover, .datatable tr.altrow:hover {
color: #000;
background-color: #FFFACD;
background-image: url(../Images/bullet.gif);
background-repeat: no-repeat;
}
But I do not see that being applied at all. My questions are
- Why is it not working?
- How to correct this?
For clarity here is the fiddle http://jsfiddle.net/naveen/UPhRE/
Please don’t mind the images inside the css. All is well there.
You are setting backgrounds on the individual table cells (
td), which is rendered on top of thetr.If you have two choices:
1) Move all row background styling to the
trs.2) Update your CSS to look like this:
This will render the color on the row:
http://jsfiddle.net/R9YGw/3/
Update: Included update for image on first cell only: