Set the :nth-child(even)
on the <td>
, not on your <input>
. In your code the <input>
is always the first child because it is wrapped inside a <td>
.
Example:
td:nth-last-child(even) input[type=text]{
background:#ccc;
}
Fiddle: http://jsfiddle.net/sfpK8/3/